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

entgql(WhereInput): remove graphql-go/graphql #267

Merged
merged 3 commits into from
Mar 26, 2022
Merged

Conversation

giautm
Copy link
Collaborator

@giautm giautm commented Mar 23, 2022

We replace graphql-go/graphql with vektah/gqlparser

This commit includes small break changes, that is will not
update the existed input in the schema.
You HAVE TO remove the duplicated input from your schema.

Refactor WhereInput feature for ent/ent#2351

@giautm giautm changed the title entgql(WhereInput): replace graphql-go/graphql entgql(WhereInput): remove graphql-go/graphql Mar 23, 2022
@giautm giautm force-pushed the refactor-where-input branch 3 times, most recently from 54b28d9 to 77a675f Compare March 23, 2022 23:32
@giautm
Copy link
Collaborator Author

giautm commented Mar 23, 2022

BC: always overwritten ent.gql

In the previous version, the EntGQL extension will check if the input data type exists in the ent.gql file, it will be left as is.
With this version, all operations are always-overridden. Therefore, if you declare the input data type in the ent.gql file, it will be deleted and replaced with the version of EntGQL.

@giautm giautm requested a review from a8m March 23, 2022 23:40
@crossworth
Copy link
Contributor

@giautm do you think it would be possible to add support for some kind of "hook" on the whereFilters part?

Maybe allowing us (users) to provide a custom genWhereInputs and export the default one (and use it when not provided), maybe export the others methods related to it as well (so we can use they on our genWhereInputs user-side implementation).

Right now, even if we change the templates for the where filters, there is no way to change the ent.graphql file, I need to add custom filters/directives on the generated file.

@giautm
Copy link
Collaborator Author

giautm commented Mar 24, 2022

Hey @crossworth, thank you for your kind words.

I plan to add some hooks for modifying the schema after we generate it from the graph. But, currently, the WhereInput and GQL Schema aren't connected yet to become a single schema. I will continue on it after this PR get merged.

Copy link
Member

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it, just a few comments before accepting.

Great work @giautm.

entgql/extension.go Show resolved Hide resolved
entgql/extension.go Show resolved Hide resolved
entgql/internal/todo/ent.graphql Show resolved Hide resolved
Copy link
Member

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 💯

@giautm giautm force-pushed the refactor-where-input branch from 77a675f to db170e7 Compare March 26, 2022 16:37
@giautm giautm merged commit 2b823ff into master Mar 26, 2022
@giautm giautm deleted the refactor-where-input branch March 26, 2022 16:41
@a8m
Copy link
Member

a8m commented Mar 26, 2022

Thanks for landing this @giautm. For next time, please use <package>: <message> as a commit format.

Also, your PRs were merged to gqlparser, so you're welcome to add the printer change here 😃

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.

3 participants