Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

New Version 0.32. Query Model 'ModelConventionConnection' is already registered #64

@rheid

Description

@rheid

Hi David Lee, thank you very much for the update to the GraphQL version of .NET. I have started to switch to this version and have found a few problems. I am using two Querys variables with optional values. These are now throwing an exception in the new version.

        queryBuilderFactory.Create<Event>(coreQuery, "GetEvent")
        .WithPaging()
        .WithParameterBuilder()
        .WithProperty(x => x.Audiences, true)
        .WithProperty(x => x.Language, true)
        .WithProperty(x => x.Navigation, true)
        .WithProperty(x => x.MainTopics, true)
        .WithProperty(x => x.Name, true)
        .WithProperty(x => x.DateStart, true)
        .WithProperty(x => x.Place,true)
        .WithProperty(x => x.Abstract, true)
        .WithProperty(x => x.Description,true)

        .BeginQuery<Event>()

        .BuildQueryResult(ctx =>
        {
            var query = ctx.GetQueryResults<Event>();
            ctx.SetResults(query.OrderByDescending(q => q.CreatedOn).ToList());
        })
        .BuildQuery()
        .BuildWithListResult();


        queryBuilderFactory.Create<Page>(coreQuery, "GetPage")
            .WithPaging()
            .WithParameterBuilder()
            .WithProperty(x => x.Audiences, true)
            .WithProperty(x => x.Language, true)
            .WithProperty(x => x.Navigation, true)
            .WithProperty(x => x.MainTopics, true)
            .WithProperty(x => x.Name, true)
            .WithProperty(x => x.CreatedOn, true)
            .BeginQuery<Page>()

            .BuildQueryResult(ctx =>
            {
                var query = ctx.GetQueryResults<Page>();
                ctx.SetResults(query.OrderByDescending(q => q.CreatedOn).ToList());
            })
            .BuildQuery()
            .BuildWithListResult();

2021-01-24T17:08:49.819Z] Executed 'graphql' (Failed, Id=02497ed2-43ed-44cb-86f5-949e83684772, Duration=17089ms)
[2021-01-24T17:08:49.821Z] System.Private.CoreLib: Exception while executing function: graphql. GraphQL: Unable to register GraphType 'GraphQL.Types.Relay.ConnectionType2[[Eklee.Azure.Functions.GraphQl.ModelConventionType1[[genesis.com.api.Models.Page, genesis.com.api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Eklee.Azure.Functions.GraphQl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[GraphQL.Types.Relay.EdgeType1[[Eklee.Azure.Functions.GraphQl.ModelConventionType1[[genesis.com.api.Models.Page, genesis.com.api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Eklee.Azure.Functions.GraphQl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], GraphQL, Version=3.3.1.0, Culture=neutral, PublicKeyToken=null]]' with the name 'ModelConventionConnection';
the name 'ModelConventionConnection' is already registered to 'GraphQL.Types.Relay.ConnectionType2[[Eklee.Azure.Functions.GraphQl.ModelConventionType1[[genesis.com.api.Models.Event, genesis.com.api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Eklee.Azure.Functions.GraphQl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[GraphQL.Types.Relay.EdgeType1[[Eklee.Azure.Functions.GraphQl.ModelConventionType1[[genesis.com.api.Models.Event, genesis.com.api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Eklee.Azure.Functions.GraphQl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], GraphQL, Version=3.3.1.0, Culture=neutral, PublicKeyToken=null]]'.

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