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

Add @foreignConnectionFieldName smart tag #177

Merged
merged 3 commits into from
Feb 8, 2023
Merged

Conversation

benjie
Copy link
Member

@benjie benjie commented Feb 8, 2023

Idea is that by default you just specify @foreignFieldName and we feed that into inflection.connectionField(...) or inflection.listField(...) as appropriate. If you want to override the specific connection field or list field, you can use the @foreignConnectionFieldName or @foreignSimpleFieldName respectively.

This is technically a breaking change versus V4, but will only impact you if you override the connectionField inflector to add a suffix/prefix (as is done in @graphile/simplify-inflection when pgOmitListSuffix = true). For consistency, we think this is the right change.

…nflection.connectionField(...)` or `inflection.listField(...)` inflector as appropriate. If you are using `@foreignSimpleFieldName` you may be able to delete that now; alternatively you should consider renaming `@foreignFieldName` to `@foreignConnectionFieldName` for consistency.
@benjie benjie merged commit 204d129 into planning Feb 8, 2023
@benjie benjie deleted the inflection-tweak branch February 8, 2023 10:09
jvandermey pushed a commit to jvandermey/pg-many-to-many that referenced this pull request Feb 8, 2023
By default, use the @manyToManyFieldName to override both connection
and simple field names by feeding it to `inflection.connectionField(...)`
or `inflection.listField(...)` as appropriate.

The field names can be fully overridden (i.e. no additional inflectors applied)
with the `@manyToManyConnectionFieldName` or `@manyToManySimpleFieldName` smart
comments.

This makes the field name override behavior consistent with change
introduced in graphile/crystal-pre-merge#177
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