You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collections created starting with numeric or "-" ( dashes ) break queries to POST /graphql
Appears to be a validation issue enforced by graphql express router, but not enforced by validation on the Directus front-end when creating a data model. POST /graphql returns 500
When collections starting with numbers or containing dashes are removed, graphql endpoint works again as expected.
Thanks!
To Reproduce
Create a collection ( Data Model ) with name either starting with numbers or containing "-" ( dashes ). Query graphql. Some queries work, some error. The odd thing is the query can be for an unrelated collection, but the validation error comes up reporting the offending collection name. Perhaps all the collections are looped through regardless of the graphql query and that triggers the error. The result is a 500 from POST /graphql.
Errors Shown
at assertValidSchema (/home/web-nodejs/directus/express-api/node_modules/graphql/type/validate.js:69:11)
at validate (/home/web-nodejs/directus/express-api/node_modules/graphql/validation/validate.js:51:35)
at GraphQLService.execute (/home/web-nodejs/directus/express-api/node_modules/directus/dist/services/graphql.js:92:57)
at /home/web-nodejs/directus/express-api/node_modules/directus/dist/controllers/graphql.js:27:40
at scoped (/home/web-nodejs/directus/express-api/node_modules/directus/dist/utils/async-handler.js:5:60)
at Layer.handle [as handle_request] (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:328:13)
at /home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:346:12)
at next (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:280:10)
17:43:58 🚨 Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "410_Webpage_Numbers" does not.
What version of Directus are you using?
9.10.0
What version of Node.js are you using?
v14.19.2
What database are you using?
MySQLl 5.7.x
What browser are you using?
Chrome
How are you deploying Directus?
server
The text was updated successfully, but these errors were encountered:
Describe the Bug
Collections created starting with numeric or "-" ( dashes ) break queries to POST /graphql
Appears to be a validation issue enforced by graphql express router, but not enforced by validation on the Directus front-end when creating a data model. POST /graphql returns 500
When collections starting with numbers or containing dashes are removed, graphql endpoint works again as expected.
Thanks!
To Reproduce
Create a collection ( Data Model ) with name either starting with numbers or containing "-" ( dashes ). Query graphql. Some queries work, some error. The odd thing is the query can be for an unrelated collection, but the validation error comes up reporting the offending collection name. Perhaps all the collections are looped through regardless of the graphql query and that triggers the error. The result is a 500 from POST /graphql.
Errors Shown
at assertValidSchema (/home/web-nodejs/directus/express-api/node_modules/graphql/type/validate.js:69:11)
at validate (/home/web-nodejs/directus/express-api/node_modules/graphql/validation/validate.js:51:35)
at GraphQLService.execute (/home/web-nodejs/directus/express-api/node_modules/directus/dist/services/graphql.js:92:57)
at /home/web-nodejs/directus/express-api/node_modules/directus/dist/controllers/graphql.js:27:40
at scoped (/home/web-nodejs/directus/express-api/node_modules/directus/dist/utils/async-handler.js:5:60)
at Layer.handle [as handle_request] (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:328:13)
at /home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:346:12)
at next (/home/web-nodejs/directus/express-api/node_modules/express/lib/router/index.js:280:10)
17:43:58 🚨 Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "410_Webpage_Numbers" does not.
What version of Directus are you using?
9.10.0
What version of Node.js are you using?
v14.19.2
What database are you using?
MySQLl 5.7.x
What browser are you using?
Chrome
How are you deploying Directus?
server
The text was updated successfully, but these errors were encountered: