You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No types required: this is used during composition check to say whether a field can be resolved by multiple subgraphs or used as another Graph's @key (which is implicitly shareable)
ReferenceResolver<
Maybe<ResolversTypes["User"]>,
{ __typename: "User" }
& GraphQLRecursivePick<ParentType, { id: true }> // <-- from @key, must always be here
& GraphQLRecursivePick<ParentType, { firstName?: true; lastName?: true }> <-- from @requires
& GraphQLRecursivePick<ParentType, { firstName?: true; lastName?: true, title?: true }> <-- from @requires
& GraphQLRecursivePick<ParentType, { birthyear?: true }> <-- from @requires
, ContextType
>
Note: the type for @requires needs a re-think because if fullName is in the selection set, firstName and lastName must exist in the ref together. The example above is saying there could be a scenario where firstName is there but lastName is not. We need something like AnyCombinationOf<ArrayOfRequiresOptions>
__resolveReference
should return mapper if available@key
work e.g.@key(fields: "id anotherId")
@key
work e.g.@key(fields: "id organization { id }")
@key
work e.g.@key(fields: "id") @key(fields: "id2")
@key
(which is implicitly shareable)@external
, do not generate resolver types.@external
, generate the base type but not resolver types@provides
is used on an@external
field, the field resolver type is generated@provides
works with nested path@requires
must use the normal mappers, instead of theGraphQLRecursivePick
with the@key
and@requires
fields.@requires
, the__resolveReference
's ref must have a union of possible combination e.g.Then, the type of
reference
is something like:Note: the type for
@requires
needs a re-think because iffullName
is in the selection set,firstName
andlastName
must exist in the ref together. The example above is saying there could be a scenario wherefirstName
is there butlastName
is not. We need something likeAnyCombinationOf<ArrayOfRequiresOptions>
Enterprise directives
The text was updated successfully, but these errors were encountered: