Skip to content

(outdated samples?) This graph type 'OutputObjectGraphType<Book>' with name 'Book' has already been initialized.  #237

@fgroen

Description

@fgroen

Hey all,

I'm in the proces of upgrading to GQL v7 and I need a little bit of help.
We have a fairly big schema and it also contains some unions. So I was waiting for the issue described in #234 to be fixed. After upgrading to v7.2 our tests are failing and I'm getting other issues now.

So, after trying to fix this for an hour, I decided to build the SimpleWebApp from the samples.
When using GraphQL.NET 7.1.1 or later I'm getting this on the first execution:

"message": "Error executing document. A different instance of the GraphType 'OutputObjectGraphType<Author>' with the name 'Author' has already been registered within the schema. Please use the same instance for all references within the schema, or use GraphQLTypeReference to reference a type instantiated elsewhere.",

And this when I execute my query another time:

"message": "Error executing document. This graph type 'OutputObjectGraphType<Book>' with name 'Book' has already been initialized. Make sure that you do not use the same instance of a graph type in multiple schemas. It may be so if you registered this graph type as singleton; see https://graphql-dotnet.github.io/docs/getting-started/dependency-injection/ for more info.",

The change log for GraphQL.NET 7.1.1 is showing me this issue I'm experiencing: graphql-dotnet/graphql-dotnet@7.1.0...7.1.1
Might this be another issue in the GraphQL.NET project or am I just totally missing something in the migration documentation?

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