ZeroQL icon indicating copy to clipboard operation
ZeroQL copied to clipboard

GraphQlType Annotation in Fragments from different assembly

Open mate1213 opened this issue 1 month ago • 0 comments

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]

mate1213 avatar Nov 11 '25 07:11 mate1213