-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve visiblity / type filtering #5014
Comments
I'm having an issue with the latest version of the gem related to this work in the tests for my mutations. In my tests I call this context = { current_user: user }
Mutations::AcceptDiscussionEmailInvite.new(object: nil, field: nil, context: context).resolve(**args) And with the latest gem version I am getting this error: NoMethodError: undefined method `types' for { :current_user=> <User> }
test/graphql/mutations/accept_discussion_email_invite_test.rb:8:in `new' Any thoughts on what I should be passing into the mutation as the context for my tests? Looks like a hash doesn't work anymore. |
Figured it out, context = { current_user: user }
context = GraphQL::Query::Context.new(query: GraphQL::Query.new(MapleSchema), values: context)
Mutations::AcceptDiscussionEmailInvite.new(object: nil, field: nil, context: context).resolve(**args) |
Hey, sorry for the disruption there. Initializing Mutations outside of query execution isn't a formally supported API, but I'm glad you found something that works. In a pinch, another way to get a context is: query = MySchema.query_class.new(self, "{ __typename }", context: { ... } )
context = query.context Also, you could try the |
This is all released in 2.4.0 |
In #4998, I started on a new schema visibility implementation. I have a few goals here:
Query#types
interface to support logging when the two systems would divergeI'm opening this issue for my own purposes but also in case anyone wants to share any thoughts or questions on the work.
TODO:
Subset
cache-by-name systemSubset
thanself.use_schema_subset = true
The text was updated successfully, but these errors were encountered: