go-proto-gql
go-proto-gql copied to clipboard
Directives in options.graphql
In your example example/codegen/pb/options.graphql There are the directives of the services
directive @Query on FIELD_DEFINITION
directive @Service on FIELD_DEFINITION
directive @Test on FIELD_DEFINITION
This is automatically added with your generator. But the individual serviceNames don't get the @Service automatically or do they?
For Example in line 84
serviceMutate1(in: DataInput): Data @Service
Is there a reason of this directives in general? And would it be helpful for you to automatically add this Directives to the specific services?
Hi what do you mean by individual services and specific services?
This directive is added so you can more easy apply interceptors to endpoints (for example to add authentication)
If you don't need it you can disable it using svc=false parameter when generating code (check the example)