Skip to content

undefined method `definition_default_resolve' after 1.11.5 upgrade #3181

@ajkerr

Description

@ajkerr

Describe the bug

After attempting to upgrade to version 1.11.5, we are getting the following error raised when trying to access a scalar on one of our queries. This did not occur in version 1.11.4.

Versions

graphql version: 1.11.5
rails (or other framework): 6.0.3.3
graphql-batch: 0.4.3
graphql-client: 0.16.0

GraphQL schema

The problem seems to be related to accessing the originalSrc scalar on this GraphQL type:

https://shopify.dev/docs/admin-api/graphql/reference/object/image

GraphQL query

Example GraphQL query and response (if query execution is involved)

query ProductVariants($first: Int!, $query: String!, $after: String) {
  productVariants(first: $first, after: $after, query: $query) {
    pageInfo {
      hasNextPage
    }
    edges {
      cursor
      node {
        id
        sku
        image {
          originalSrc
        }
        product {
          id
          title
          hasOnlyDefaultVariant
          tags
          images(first: 1) {
            edges {
              node {
                originalSrc
              }
            }
          }
        }
      }
    }
  }
}

Steps to reproduce

Run the query and attempt to access image.original_src on one of the nodes.

Expected behavior

The query should work.

Actual behavior

What specifically went wrong?

Place full backtrace here (if a Ruby exception is involved):

Click to view exception backtrace
          NoMethodError:
            undefined method `definition_default_resolve' for #<GraphQL::Schema ...>
            Did you mean?  define_singleton_method
          # /Users/ajkerr/.gem/ruby/2.7.1/gems/graphql-1.11.5/lib/graphql/schema/build_from_definition.rb:207:in `coerce_input'
          # /Users/ajkerr/.gem/ruby/2.7.1/gems/graphql-1.11.5/lib/graphql/schema/member/validates_input.rb:24:in `coerce_isolated_input'
          # /Users/ajkerr/.gem/ruby/2.7.1/gems/graphql-client-0.16.0/lib/graphql/client/schema/scalar_type.rb:38:in `cast'
          # /Users/ajkerr/.gem/ruby/2.7.1/gems/graphql-client-0.16.0/lib/graphql/client/schema/non_null_type.rb:39:in `cast'
          # /Users/ajkerr/.gem/ruby/2.7.1/gems/graphql-client-0.16.0/lib/graphql/client/schema/object_type.rb:71:in `block (3 levels) in <module:ObjectType>'
          # /Users/ajkerr/.gem/ruby/2.7.1/gems/graphql-client-0.16.0/lib/graphql/client/schema/object_type.rb:70:in `fetch'
          # /Users/ajkerr/.gem/ruby/2.7.1/gems/graphql-client-0.16.0/lib/graphql/client/schema/object_type.rb:70:in `block (2 levels) in <module:ObjectType>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions