Skip to content

How to set up resolve_type for loads in 2.2? #4797

Answered by bmulholland
bmulholland asked this question in Q&A
Discussion options

You must be logged in to vote

Found the code from https://github.com/rmosolgo/graphql-ruby/pull/4678/files#diff-ca02a7189be9dc9f1c0d328028ba139f8be8da82eca96bbfccd3c098b5ad03f7L934

So a basic example would be:

  def self.resolve_type(type, _obj, _ctx)
    if type.kind.object?
      type
    else
      raise "Needs configuration"
    end
  end

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@rmosolgo
Comment options

@bmulholland
Comment options

@rmosolgo
Comment options

@bmulholland
Comment options

@iesahin
Comment options

Answer selected by bmulholland
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants