Skip to content

GraphQlType Annotation in Fragments from different assembly #152

@mate1213

Description

@mate1213

Describe the bug

In a query where I use a fragment where multiple filter object inserted into the fragment, when I define that fragment in a different library (as a partial), than GraphQLType annotation raise an error for duplicate annotation.

The issue is that the filter object's type not regocnized correctly, and only the name of the argument has been inserted into the final graphQL querry.

If fragment defined in the Library where it's used the issue is not present.

How to Reproduce

  1. Create project
  2. Build zeroQL client
  3. Create a fragment like:
public static partial MyOwnType ConvertToMyType(this ZeroQLGeneratedType source, [GraphQLType("DummyFilter1")]DummyFilter1 filter1, [GraphQLType("[DummyFilter2]")]DummyFilter2[] filter2)
{
    return new MyOwnType() {
        Object1 = source.Object1(
            filter: filter1,
            selector: source2 => new Object1() {
                Object2 = source2.Object2(o2 => o2.ConvertToMyType(filter2))
        })
    }
}
  1. Create an other project
  2. Query the ZeroQLGeneratedType object, than use the fragment above

This way the error regarding the duplicated annotation appear.

If we remove the annotation, the code became buldable, but the 2 filter object's type has not setted correctly.

Expected behavior

The annotation could be applied.

Environment (please complete the following information):

  • Nuget package version [7.0.3]
  • IDE: [VS]
  • .Net Version [8.0.21]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions