Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoc-gen-ent: support entgql.Annotation #592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simon-wenmouth
Copy link

Added support for entgql.Annotation to the protoc-gen-ent plugin. It should now be possible to generate an Ent schema and its GraphQL configuration from a Protocol Buffer file.

The opts.proto was updated adding GQL child MessageTypes to the existing MessageTypes (Schema, Field, Edge). The associated generated code (opts.pb.go) was regenerated using protoc-gen-go.

The AST generation code in schemaast/annotation.go was updated to know about the entgql annotations. The new method attempts to generate code similar to that in the documentation.

The main package was updated to map the configuration settings in the updated opts.proto to the corresponding annotations for the schema, fields, and edges.

@simon-wenmouth
Copy link
Author

It looks like I should regenerate the opts.pb.go using [email protected] and [email protected]. I'll update the PR in case this introduces a breaking change for others.

@simon-wenmouth
Copy link
Author

I've updated the version of protoc to match the previous generated version (only a comment changed).

Added support for `entgql.Annotation` to the `protoc-gen-ent` plugin.
It should now be possible to generate an Ent schema and its GraphQL
configuration from a Protocol Buffer file.

The `opts.proto` was updated adding `GQL` child MessageTypes to the
existing MessageTypes (`Schema`, `Field`, `Edge`).  The associated
generated code (`opts.pb.go`) was regenerated using `protoc-gen-go`.

The AST generation code in `schemaast/annotation.go` was updated to know
about the `entgql` annotations.  The new method attempts to generate
code similar to that in the documentation.

The main package was updated to map the configuration settings in the
updated `opts.proto` to the corresponding annotations for the schema,
fields, and edges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant