-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Align @defer / @stream compiler assumptions to GraphQL spec #4159
Align @defer / @stream compiler assumptions to GraphQL spec #4159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this!
I think @rbalicki2 were also looking into this at some point (so maybe have more context).
Specifically for this PR - I don't think we will be able to land that internally. So we need to figure out the strategy on how to make this work.
Some high-level observations:
-
We need to be able to minimize the changes in this diff to reduce the risk of breaking things internally.
-
For the
@defer/@stream
we need to somehow express to the compiler what type of directive is expected. Maybe via config, I think we have schema_config section in the compiler config maybe put it there. We can add an explicit version - something like what type of arguments is expected, or even SDL for these directives, or maybe have something like enum DEFER_STREAM_MODE = CustomRelay | OSS
I also just watched the GraphQL spec meetings of December and there seems to be once more discussion around the shape of the response. In particular the necessity of the |
Any updates? |
I can have another go at this in the coming weeks. I'll try to add a config option and keep the default as the previous behavior so all the test changes and so on can be reverted again and we have a smaller diff to land |
Closing this in favor of #4467 |
Changes
@stream
initial_count
argument toinitialCount
initial_count
argument to be not defined, since the official directive definition specifies it as nullable and with a default value of0
initialCount
argument being a non-negative int, if it's definedif
argument non-null@defer
if
argument non-nullOpen questions
@stream_connection
? I haven't touched its signature yet, since it's not part of the GraphQL specification.@stream
/@defer
are experimental features in OSS, so it shouldn't be a problem to just ship these changes. To my knowledge, Meta should be using these features in production though. Is this a blocker for these breaking changes?Closes #4158