Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: filtered introspection queries #46
feat: filtered introspection queries #46
Changes from all commits
b0a34e2
c6c7c04
1d07402
526d42b
2224940
2217b46
30a3d2f
cac0cfb
adfab99
94b46b7
ff27b42
bf97056
31ebe24
8cbfca8
e1ed78d
0d9d733
18fd4fd
dd0e7bd
f31db99
990d13e
1e75662
21f8392
1052b46
4da1bfe
9ace190
fe33ea7
9a768d3
9fea7ab
73a56e9
925f2fb
34d8b6e
d50f00c
c711390
96b72fe
28a7db4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
graphql-tools is not a depdency. Could we avoid it? Or just add it as a dependency?
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.
I have added it to the package.json
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.
How feasible would it be to not include this dependency?
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.
I have checked it and it requires a lot of GraphQL knowledge about the spec and the
graphqljs
implementation to manage all the use cases.I'm monitoring this issue: graphql/graphql-js#113
Or it could be best to include this feature in the official graphql implementation.
At the moment the issue is 5 years old but still active (people want it)
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.
I'm trying to create the
GraphQLResolveInfo
that contains information about the operation's execution state, including the field name.I did not cover all the cases, but it will be slightly different from the
info
argument received as input by the resolver function.Any suggestion to recreate it is highly appreciated
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.
Apologies for the slow response, I've been very busy this week - I will have a look this weekend if that's okay!
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.
There are a couple of functions exported from the
graphql
package that might be of interest here:buildExecutionContext
buildResolveInfo
(requires an execution context)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.
I did not find a way to build the info object actually.
Would you mind defining a subset info object in the first place?
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.
Do you anticipate this being problematic for the type definition of the
GraphQLResolveInfo
type?Depending on the data included, I think this is okay for the initial release of this feature if it's not possible - we'd need to:
What was blocking you on this out of interest?
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.
Let me make an example:
if you assign the
@auth
directive to atype MyObject
and you will set this type as output for two differentQuery
, theinfo
object depends on the query that is being executed - the resolver changes.Instead, during the filtering, the
applyPolicy
function is not being executed as a resolver wrapper, but it is executed on theMyObject
type without any other context.For this reason I was unable to build the same argument