When using schema stitching, how the @merge/@key directive should look like for an endpoint that receives 2 or more arguments? #2784
-
Hello, This is my schema:
So my As a workaround, i did this:
It works as expected but i don't want to apply this restriction to all my endpoints and only allow them to have 1 argument. I need to allow endpoints to receive multiple input arguments. I red all the Directives SDL documentation but couldn't wrap my head around it and make this work... Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You are doing nothing wrong at all! The current basic arguments to the The Leaving out The thought is that in most cases, the additional arguments will be static, which can be customized via the Of course, most is not at all. We decided not to complicate what's already complicated by supporting more complex syntax to For now, we have the following additional not so documented arguments:
We are open to pull requests if you want to work on multiple |
Beta Was this translation helpful? Give feedback.
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…