Skip to content

NotImplementedError (schema contains Interfaces or Unions, so you must define a resolve_type -> (obj, ctx) { ... } function): #1205

Closed
@ghost

Description

If I follow this guide: http://tech.eshaiju.in/blog/2017/06/09/dry-graphql-definitions-using-interfaces/

I have this error:
NotImplementedError (schema contains Interfaces or Unions, so you must define a resolve_type -> (obj, ctx) { ... } function):

I'm using a simple player_type.rb:

Types::PlayerType = GraphQL::ObjectType.define do
  name 'Player'

  interfaces [Interfaces::ActiveRecordTimestamp]

  field :id, !types.ID
  field :team_id, !types.ID
end

and this:

Interfaces::ActiveRecordTimestamp = GraphQL::InterfaceType.define do
  name 'ActiveRecordTimestamp'

  field :createdAt, types.String, property: :created_at
  field :updatedAt, types.String, property: :updated_at
end

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