Skip to content

Error when building same schema for different service collections #144

@Fgruntjes

Description

@Fgruntjes

When initialising the same schema for multiple ServiceCollection's you can only do this when calling UseGraphQL before you run AddGraphQL on the second collection.

var service1Collection = new ServiceCollection();
var service2Collection = new ServiceCollection();

service1Collection.AddGraphQL<CandleSchema>(options =>
{
    options.AddGraphType<Candle>();
});
service2Collection.AddGraphQL<CandleSchema>(options =>
{
    options.AddGraphType<Candle>();
});

This produces the error: The schema type CandleSchema has already been registered. Each schema type may only be registered once with GraphQL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions