Skip to content

Lazy Loading of types is missing a full loading method #168

@mcg-web

Description

@mcg-web

While trying to introduce lazy loading in the overblog/graphql-bundle, the exception (GraphQL\Error\InvariantViolation: Could not find possible implementing types for Node in schema. Check that schema.types is defined and is an array of all possible types in the schema.) is throw when combining types lazy loading and `assertValid. This exception is throw because when using typeLoader there's no existing method to fully load all types. Here an example:

interface Node {
  id: ID!
}

type Query {
   node(id: String!): Node
}

type Ship implements Node {
   id: String!
   name: String
}

type Ship implements Node {
   id: String!
   name: String
}

type Faction implements Node {
   id: String!
   name: String
}

schema {
  query: Query
}

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