Skip to content

Usage of legacy .graphql_definition objects on SchemaPlugin#authenticate_optionΒ #212

@janraasch

Description

@janraasch

What is the problem the enhancement will solve?

After upgrading to graphql_devise 0.18.0 I am getting the following deprecation message from graphql 1.13.10:

Legacy `.graphql_definition` objects are deprecated and will be removed in GraphQL-Ruby 2.0. Remove `.graphql_definition` to use a class-based definition instead.

Called on #<Types::BaseField Query.myquery(...): [Mytype!]!> from:
   /Users/jan/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/graphql_devise-0.18.0/lib/graphql_devise/schema_plugin.rb:116:in `authenticate_option'
  /Users/jan/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/graphql_devise-0.18.0/lib/graphql_devise/schema_plugin.rb:30:in `trace'

Context

I set up our Schema like so

class MyServerSchema < GraphQL::Schema
  use GraphqlDevise::SchemaPlugin.new(
    query: Types::QueryType,
    mutation: Types::MutationType,
    public_introspection: true,
    resource_loaders: [
      GraphqlDevise::ResourceLoader.new(User,
                                        only: %i[login logout register update_password_with_token
                                                 send_password_reset_with_token])
    ]
  )

  mutation(Types::MutationType)
  query(Types::QueryType)

Describe the solution you have in mind

Not sure πŸ˜‡. Judging from the deprecation message, we could simply remove the call to .graphql_definition πŸ€“...

Describe alternatives you've considered

To have less noise on our test logs, I might choose to downgrade again...

Additional context

Please let me know, if you need more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions