Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: typescript-redux followups #656

Merged
merged 21 commits into from
Apr 22, 2021
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e715ab6
Refine / split metadata types (instead of ? -> !)
trevor-scheer Apr 8, 2021
bdad209
getJoins -> getJoinDefinitions
trevor-scheer Apr 8, 2021
b3bb32e
sanitizedServiceNames -> graphNameToEnumValueName
trevor-scheer Apr 8, 2021
afd924c
Address enum sanitization/uniquification comments
trevor-scheer Apr 12, 2021
5bd3f10
Use actual map for GraphMap instead to account for undefined-ness
trevor-scheer Apr 13, 2021
4378987
Clean up usages of printWithReducedWhitespace in favor of stripIgnore…
trevor-scheer Apr 13, 2021
5e40df8
Confirm parsed FieldSets do not have an injected operation
trevor-scheer Apr 15, 2021
e37e2a6
Ensure no FragmentSpreads nested in a FieldSet
trevor-scheer Apr 15, 2021
2aa3cf5
Capture caveats in comments from commit messages
trevor-scheer Apr 15, 2021
fb0f6e9
Remove incorrect nullish coalesce to ownerService
trevor-scheer Apr 15, 2021
5ac14f2
Update ordering of join__Graph enum in test mocks
trevor-scheer Apr 16, 2021
7784276
Invert metadata predicate which was always negated to its opposite
trevor-scheer Apr 21, 2021
4b7d50f
Update expectations comment
trevor-scheer Apr 21, 2021
6c4261b
Create nice helper for working with Maps (mapGetOrSet)
trevor-scheer Apr 21, 2021
524809d
Fix usage of mapGetOrSet
trevor-scheer Apr 21, 2021
208a041
Add clarity to names
trevor-scheer Apr 21, 2021
f85a597
Correct error message
trevor-scheer Apr 21, 2021
2a2c429
Simplify extra } error message
trevor-scheer Apr 21, 2021
a1156a8
Fix remaining accesses to context.graphNameToEnumValueName
trevor-scheer Apr 21, 2021
53e0ad5
Update changelogs
trevor-scheer Apr 22, 2021
fe2c2aa
Merge branch 'main' into trevor/redux-followups
trevor-scheer Apr 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions federation-js/src/service/printSupergraphSdl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
stripIgnoredCharacters,
} from 'graphql';
import { Maybe, FederationType, FederationField, ServiceDefinition } from '../composition';
import { assert } from '../composition/utils';
import { CoreDirective } from '../coreSpec';
import { getJoinDefinitions } from '../joinSpec';

Expand Down Expand Up @@ -246,10 +247,14 @@ function printTypeJoinDirectives(

// We don't want to print an owner for interface types
const shouldPrintOwner = isObjectType(type);

const enumValue = context.graphNameToEnumValueName?.[ownerService];
trevor-scheer marked this conversation as resolved.
Show resolved Hide resolved
assert(
enumValue,
`Unexpected enum value missing for subgraph ${ownerService}`,
);
const joinOwnerString = shouldPrintOwner
? `\n @join__owner(graph: ${
context.graphNameToEnumValueName?.[ownerService] ?? ownerService
})`
? `\n @join__owner(graph: ${enumValue})`
: '';

return (
Expand Down