How to generate GraphQL query from protocol buffer generated code with gqlgen?

How to generate GraphQL query from protocol buffer generated code with gqlgen?


0

I have a protocol buffer file which includes an enumeration within a message.

message Advisor {
  ...
  enum AdvisorRole {
    // here be values
  }
}

This pb is the input to generate stubs using protoc-gen-gogo.

../gen/ProjectService.pb.go

type Advisor_AdvisorRole int32
const (
    // here be constant values
  )

The generated code is in time referenced from the .gqlgen.yaml to configure the gql service code generation.

models:
...
  AdvisorRole:
    model: github.com/.../gen/pb.Advisor_AdvisorRole

Finally when execute go generate ./... the type does not exist in the execution context.

C:Users...gqlgenerated.go:40578:12: ec._AdvisorRole undefined (type *executionContext has no field or method _AdvisorRole)

I have tried taking out the enumeration from the message and updated the reference in the configuration file, but that did not make any difference.


Load 4 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *