Skip to content
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

Custom context support #18

Open
TheRusskiy opened this issue Mar 17, 2019 · 0 comments
Open

Custom context support #18

TheRusskiy opened this issue Mar 17, 2019 · 0 comments

Comments

@TheRusskiy
Copy link

TheRusskiy commented Mar 17, 2019

Hello!
Thank you for turning this into a gem.
I was wondering if there's a way to access custom context.

For example when I do

class MySchema < GraphQL::Schema
  context_class MyContext # <====
  ...
  use GraphQL::Batch
  enable_preloading
end

and later do

preload_scope: -> (args, context) {
    puts context.class.name
    ...
  }

I am getting
"GraphQL::Query::Context::FieldResolutionContext"
instead of
"MyContext"

FYI my ruby-graphql version is 1.9.3.

Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant