Skip to content

When using schema stitching, how the @merge/@key directive should look like for an endpoint that receives 2 or more arguments? #2784

Answered by yaacovCR
alexandra-c asked this question in Q&A
Discussion options

You must be logged in to vote

You are doing nothing wrong at all!

The current basic arguments to the @merge directive let you pick an argument for your root field to which you would like to forward your key, and also let you customize your key.

The keyArg argument to @merge selects the argument on the root field while either:
(A) The keyField argument to @merge selects a single field from the key (in which case the @key directive is not necessary),
(B) The key argument to @merge lets you build a custom key just for that argument from the selectionSet included by the @key directive,
(C) specifying neither will pass the entire selectionSet included by the @key directive to that argument.

Leaving out keyArg means that yo…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@alexandra-c
Comment options

@yaacovCR
Comment options

yaacovCR Apr 9, 2021
Collaborator

@alexandra-c
Comment options

@yaacovCR
Comment options

@alexandra-c
Comment options

Answer selected by alexandra-c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants