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

Extensions keyword is not supported in Multiplex #2751

Closed
JanStevens opened this issue Feb 17, 2020 · 4 comments
Closed

Extensions keyword is not supported in Multiplex #2751

JanStevens opened this issue Feb 17, 2020 · 4 comments

Comments

@JanStevens
Copy link

JanStevens commented Feb 17, 2020

Hello 👋

When using BatchLink (from Apollo) and Persisted queries apollo-link-persisted-queries I try to pass the extensions keyword to the multiplex call like so

result = if params[:_json]
        queries = Array(params[:_json]).map do |param|
          {
            query: param[:query],
            operation_name: param[:operationName],
            variables: ensure_hash(param[:variables]),
            extensions: param[:extensions],
            context: context
          }
        end
        CrewSchema.multiplex(queries)
      else
        CrewSchema.execute(params[:query],
          variables: ensure_hash(params[:variables]),
          context: context,
          extensions: params[:extensions],
          operation_name: params[:operationName])
      end

but this gives me the following stack trace:

ArgumentError (unknown keyword: extensions):
  graphql (1.10.2) lib/graphql/query.rb:81:in `initialize'
  graphql (1.10.2) lib/graphql/execution/multiplex.rb:48:in `new'
  graphql (1.10.2) lib/graphql/execution/multiplex.rb:48:in `block in run_all'
  graphql (1.10.2) lib/graphql/execution/multiplex.rb:48:in `map'
  graphql (1.10.2) lib/graphql/execution/multiplex.rb:48:in `run_all'
  graphql (1.10.2) lib/graphql/schema.rb:1541:in `multiplex'
  app/controllers/api/graphql_controller.rb:24:in `execute'
  actionpack (5.2.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
  actionpack (5.2.4.1) lib/abstract_controller/base.rb:194:in `process_action'
  actionpack (5.2.4.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
  actionpack (5.2.4.1) lib/abstract_controller/callbacks.rb:42:in `block in process_action'

I would expect that extensions would be supported when multiplexing

@rmosolgo
Copy link
Owner

What do you expect extensions to do? What kind of value are you passing there? Should graphql-ruby do anything with it?

@JanStevens
Copy link
Author

Yes,

I'm using the following gem https://github.com/DmitryTsepelev/graphql-ruby-persisted_queries to have on the fly persisted queries

@JanStevens
Copy link
Author

Ha the gem patches graphql Ruby, probably should direct the issue to them 😅

@rmosolgo
Copy link
Owner

Yes, please do. If you find something else is required from graphql-ruby, let me know!

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

2 participants