Replies: 6 comments 10 replies
-
Yeah and unfortunately the annotation |
Beta Was this translation helpful? Give feedback.
-
@bo55vxr You can either override the NamingConvetions (create a subclass of DefaultNamingConvntions and override GetTypeName and register it on the schema) or you can create customer filter types and override the names. e.g.
[GraphQLName] should actully also work. (apparently @sigmarsson has issues with it though) |
Beta Was this translation helpful? Give feedback.
-
@bo55vxr what helped me to resolve collision among
|
Beta Was this translation helpful? Give feedback.
-
Hi @sigmarsson (Nice Avatar BTW) So, using the details provided, I have created the following class
And then registered it
When I run the code and make a schema request (from Postman), if then throws the following exception There are two conventions registered for HotChocolate.Data.Filters.IFilterConvention in scope default. Only one convention is allowed. Use convention extensions if additional configuration is needed. Colliding conventions are HotChocolate.Data.Filters.FilterConvention and VAA.EAPI.GraphQL.Domain.CreateCustomer.Models.ContactDetailsConvention Using v12.15.0 of HC |
Beta Was this translation helpful? Give feedback.
-
Well, using all the information here, and a bit of creative coding, I managed to now resolve everything I need.
Custom Filter and Attribute
Registering
Service A Models
Servce B Models
|
Beta Was this translation helpful? Give feedback.
-
I had a very similar issue, but in my case, just overriding the filters wasn't enough. I had to extend the public class MyCustomNamingConventions : DefaultNamingConventions
{
public override string GetTypeName(Type type)
{
// my custom code here.
}
public override string GetTypeName(Type type, TypeKind kind)
{
// my custom code here.
}
} The code in the class is almost identical to the original base class, except that it's intented to substitute the original And to make it work, just add |
Beta Was this translation helpful? Give feedback.
-
My Graph QL sits over the top of multiple APIs and some of these APIs have classess with the same name. Consider the following..
As you can see, I have two separate name spaces each with an
Address
class but slightly different.The start up of the Graph QL system performs with no error, however when I send in a request I then get this error.
This is obviously because there are TWO addresses classes, albeit in different namespaces, but HC does not seem to recognise that.
Other than changing the name of one of the classes, is there any way to tell HC to name the filter differently?
Beta Was this translation helpful? Give feedback.
All reactions