graphql-schema-registry
graphql-schema-registry copied to clipboard
schema comparisons are not case sensitive by default
When pushing a schema update where the only change is the case of a field, the update is ignored. This is likely because of the way the registry uses SQL to compare the incoming schema to the existing schema. Since MySQL is case-insensitive by default this causes the service to believe the schema already exists.
Steps to reproduce.
- Submit the initial schema to the registry
curl -X POST http://localhost:6001/schema/push \
-H 'Content-Type: application/json' \
--data-binary @- << 'EOF'
{
"name": "schema1",
"version": "1",
"type_defs": "type MyType { id: String} type Query { my: MyType }"
}
EOF
- Now submit an update to the schema. Notice the change to the
id
field ofMyType
fromid
toId
.
curl -X POST http://localhost:6001/schema/push \
-H 'Content-Type: application/json' \
--data-binary @- << 'EOF'
{
"name": "schema1",
"version": "1",
"type_defs": "type MyType { Id: String another: String } type Query { my: MyType }"
}
EOF
- View the schema in the registry UI. Notice there is only a single version of the schema and and the definition was not changed.
I put the wrong example curl command as command 2. It should be
curl -X POST http://localhost:6001/schema/push \
-H 'Content-Type: application/json' \
--data-binary @- << 'EOF'
{
"name": "schema1",
"version": "1",
"type_defs": "type MyType { Id: String} type Query { my: MyType }"
}
EOF
solved in https://github.com/pipedrive/graphql-schema-registry/releases/tag/5.4.0