We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Just included the gem into the bundle, installed it as per README instructions, and enabled it at class Schema.
Thing is, when I add preload to a type field, as in
preload
Types::CustomerType = GraphQL::ObjectType.define do ... field :payments, !types[Types::PaymentType], preload: :payments end
Error is as cumbersome as it gets:
GraphQL::Field can't define 'preload' excluded from capture: DSN not set
Using ruby-2.5.0 and rails-5.2.2. Ps: I think it is somewhat different from the other open issue as the error occurs at ObjectType level.
ruby-2.5.0
rails-5.2.2
Can anyone shed a light here?
The text was updated successfully, but these errors were encountered:
I guess it's just a syntax error. preload: :... need to be called in a block.
preload: :...
Types::CustomerType = GraphQL::ObjectType.define do ... field :payments, !types[Types::PaymentType] do preload: :payments end end
Sorry, something went wrong.
and if you're using the old block syntax, preload is a function. so its preload :payments and NOT preload: payments
preload :payments
preload: payments
Solved with a resolver,
field :payments, [Types::PaymentType], null: false, resolver: Resolvers::AssocCustomerPayments
simpler and (I hope) more stable syntax.
No branches or pull requests
Just included the gem into the bundle, installed it as per README instructions, and enabled it at class Schema.
Thing is, when I add
preload
to a type field, as inError is as cumbersome as it gets:
Using
ruby-2.5.0
andrails-5.2.2
. Ps: I think it is somewhat different from the other open issue as the error occurs at ObjectType level.Can anyone shed a light here?
The text was updated successfully, but these errors were encountered: