You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
The type CollectionSegmentInfo is defined within HotChocolate for paging responses. Considering that, two subgraphs that use this same type end up with the below error on rover subgraph validation.
INVALID_FIELD_SHARING: Non-shareable field "CollectionSegmentInfo.hasNextPage" is resolved from multiple subgraphs:
INVALID_FIELD_SHARING: Non-shareable field "CollectionSegmentInfo.hasPreviousPage" is resolved from multiple subgraphs: it is resolved from subgraphs "a" and "b" and defined as non-shareable in subgraph "a"
These are troublesome to add decorators to e.g. I've had to do this to add a @tag decorator to them
publicclassPublicTypeInterceptor:TypeInterceptor{publicoverridevoidOnBeforeCompleteType(ITypeCompletionContextcompletionContext,DefinitionBasedefinition){if(definition is not IHasDirectiveDefinition otd)return;switch(definition.Name){case"ProductCollectionSegment":case"CollectionSegmentInfo":
otd.AddDirective("tag",new[]{new ArgumentNode("name","public")});break;}base.OnBeforeCompleteType(completionContext, definition);}}
It'd be great to provide some ease of configuration or at least "standards" to be opted in to say so that such things such as @shareable might be added to some of these types to avoid every team having to provide a type interceptor to add these decorators and hence avoid conflicts such as the error above. The code example of adding the tag decorator might be specific to us, but again, does become something that needs repeating in each subgraph for a pageable type that needs it
n.b. I believe there are other common types e.g. cursor based paging vs token based that might also be included in this general nice to have outcome
The text was updated successfully, but these errors were encountered:
The type
CollectionSegmentInfo
is defined within HotChocolate for paging responses. Considering that, two subgraphs that use this same type end up with the below error on rover subgraph validation.These are troublesome to add decorators to e.g. I've had to do this to add a
@tag
decorator to themIt'd be great to provide some ease of configuration or at least "standards" to be opted in to say so that such things such as
@shareable
might be added to some of these types to avoid every team having to provide a type interceptor to add these decorators and hence avoid conflicts such as the error above.The code example of adding the tag decorator might be specific to us, but again, does become something that needs repeating in each subgraph for a pageable type that needs it
n.b. I believe there are other common types e.g. cursor based paging vs token based that might also be included in this general nice to have outcome
The text was updated successfully, but these errors were encountered: