Open zoidbergSF opened 1 year ago
@zoidbergSF Do you have naming_convention
in any of your source metadata by any chance?
Yes, we recently added a second postgres database to our server, which has the naming_convention: graphql-default
set in its customization in the databases.yaml
file. The primary
database was configured some time ago already before naming_convention
options became available.
This metadata setting will set the naming convention as it overrides the environment variable configuration. This is expected behavior. Did you not intend to add the naming_convention to your source?
On Fri, Mar 24, 2023, 3:31 PM zoidbergSF @.***> wrote:
Yes, we recently added a second postgres database to our server, which has the naming_convention: graphql-default set in its customization in the databases.yaml file. The primary database was configured some time ago already before name_convention options became available.
— Reply to this email directly, view it on GitHub https://github.com/hasura/graphql-engine/issues/9523#issuecomment-1482541206, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCDEEVV36Y43WXBTW4WL53W5VWGXANCNFSM6AAAAAAWGJRYVM . You are receiving this because you commented.Message ID: @.***>
@tirumaraiselvan thanks for the reply,
yes we did intend to add the naming_convention
to the second postgres device
database when we added it as a source, and the names on these tables were generated as expected, And since we configured the graphql-default
naming_convention only on that database in the databases.yaml
file, we did not see any changes to the schema generated on the primary
database, again as expected.
This was all done while running v2.8.4
without encountering issues. However this week while upgrading to v2.20.0
and making no changes, we see the generated field names change for filtering options on tables in the primary
database, as seen in the users
query above.
This is unexpected because:
naming_convention: graphql-default
specified in the customization options of the primary
database, therefore didn't expect the query field names to have changed to the graphql-default
convention.v2.8.4
and field names only changed when updating to v2.20.0
, even though we did not change anything else other than updating the hasura version.@zoidbergSF, thanks for raising the issue. I could not reproduce this issue. Can you please help me out? I did the following:
HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: naming_convention
.Add two sources (default
and device
)
Observe that the field exposed from the device
source is following the hasura-default
naming convention.
hasura/graphql-engine:v2.20.0
, and start again.After updating to
v2.20.0
there are field name changes for filters in queries on tables of theprimary
database even though > it does not havenaming_convention: graphql-default
set in its configuration, for example:users(where: {deletedAt: {_is_null: false}}) { #... }
becomes
users(where: {deletedAt: {_isNull: false}}) { #... }
As far as I can tell, the users
field is exposed from a source that follows the graphql-default
naming convention in both cases. In v2.20.0, we fixed a bug where a few operators were not changing based on the naming convention and _is_null
was one of them. I guess this might be the reason why the _is_null
operator became _isNull
in v2.20.0.
The commit for the mentioned bugfix: https://github.com/hasura/graphql-engine/commit/96549b272b07d5fdb82207829104ae626f4c6cb3
Version Information
Server Version: 2.20.0
Environment
OSS
What is the current behaviour?
When updating our server from
v2.8.4
tov2.20.0
we get unexpected field name changes on the generated schema causing breaking changes to our API. We have theHASURA_GRAPHQL_EXPERIMENTAL_FEATURES: naming_convention
environment variable set, and we do not have theHASURA_GRAPHQL_DEFAULT_NAMING_CONVENTION: graphql-default
variable set.We have 2 postgres databases connected with the following configuration in the
databases.yaml
file:After updating to
v2.20.0
there are field name changes for filters in queries on tables of theprimary
database even though it does not havenaming_convention: graphql-default
set in its configuration, for example:becomes
What is the expected behaviour?
Upgrading from server version
v2.8.4
tov2.20.0
should not introduce filter field name changes to the schema generated from theprimary
database which does not havenaming_convention: graphql-default
configured.Keywords