-
Notifications
You must be signed in to change notification settings - Fork 519
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
Variables and Context #1
Conversation
Question: How are the variables passed along with a request? Are they additional http parameters or something? Is there a special section of the graphql doc for them? |
Example: Yes; it's really up to how you feed the values into
|
And that's the "client provides the document" approach. Later, if we stored the docs server-side, it could be something like:
Where |
Oh, boy did this turn out to be more complex than I thought. Pretty good result, though -- support for error reporting on missing values (but still executing the document), support for defaults, etc. I'm going to merge this down and make a PR to support these changes in our project. |
Delegate to NG for Schema Hiding
Besides arguments, there are two additional sources of values for resolution: execution variables (which should relate to variables declared in the query document and probably provided by HTTP params, etc) and context (which are additional, system-provided values like the current user, etc). Notably, the difference here is that
variables
are should be of type%{binary => any}
, wherecontext
can be%{any => any}
(and, in practice, will probably be%{atom => any}
).This PR deconflates execution variables and context and adds testing, changes needed to ensure variables are being looked up correctly.