graphql-dotnet / conventions

GraphQL Conventions Library for .NET
MIT License
233 stars 63 forks source link

Fields getting derived in depth even they are ignored #203

Closed yokan87 closed 4 years ago

yokan87 commented 4 years ago

Hi,

For example, I've got the following classes:

public class GqlClass { public NonNull Text { get; set; }

[Ignore]
public MyClass ToMyClass()
{
    return new MyClass();
 }

}

public class MyClass { public T SomeGenericMethod() { return default(T); } }

When I use the GqlClass in a Query class, the startup fails because the field derivation goes through the class "MyClass" and gets an error because of the generic type parameter:

"Cannot create an instance of GraphQL.Conventions.Adapters.Types.OutputObjectGraphType`1[T] because Type.ContainsGenericParameters is true."

Popeye4242 commented 4 years ago

I'm having the same issue here. @tlil

tlil commented 4 years ago

Thanks for submitting the fix, @jdomnick - merged and will release in a few. Apologies for the delay in getting back to you.