Closed
Description
Describe the bug
Hey, I have some trouble with the rename transformation
The situation :
I have a legacy database with some fields start by number. So I got error I do not apply the rename transformation , no problem I am okay with this !
To Reproduce
Steps to reproduce the behavior:
Have a mysql table with two column name start by number and apply this config:
.meshrc.yaml
sources:
- name: Legacy
handler:
mysql:
host: 127.0.0.1
port: 3306
user: POMME
password: 'FRITE'
database: scoubidou
transforms:
- rename:
mode: wrap
renames:
- from:
type: Users
field: 2way_authentication
to:
type: Users
field: two_way_authentication
- from:
type: Users
field: 2way_authentication_token
to:
type: Users
field: two_way_authentication_token
- from:
type: UsersOrderByInput
field: 2way_authentication
to:
type: UsersOrderByInput
field: two_way_authentication
- from:
type: UsersOrderByInput
field: 2way_authentication_token
to:
type: UsersOrderByInput
field: two_way_authentication_token
- from:
type: UsersWhereInput
field: 2way_authentication
to:
type: UsersWhereInput
field: two_way_authentication
- from:
type: UsersWhereInput
field: 2way_authentication_token
to:
type: UsersWhereInput
field: two_way_authentication_token
- from:
type: UsersInsertInput
field: 2way_authentication
to:
type: UsersInsertInput
field: two_way_authentication
- from:
type: UsersInsertInput
field: 2way_authentication_token
to:
type: UsersInsertInput
field: two_way_authentication_token
- from:
type: UsersUpdateInput
field: 2way_authentication
to:
type: UsersUpdateInput
field: two_way_authentication
- from:
type: UsersUpdateInput
field: 2way_authentication_token
to:
type: UsersUpdateInput
field: two_way_authentication_token
The server launch without any exception
And i can query like this :
// just display the id
{
getUsers(limit: 1){
id
}
}
//OR
// just display the id and with filter on the new name
{
getUsers(where:{two_way_authentication:"2"}){
id
}
}
But if i try to display the new field with his new name i have execption
{
getUsers(limit: 1){
id
two_way_authentication_token
}
}
//OR
{
getUsers(where:{two_way_authentication:"2"}){
id
two_way_authentication_token
}
}
i got this error:
{
"errors": [
{
"message": "Invalid or unexpected token",
"path": [
"getUsers"
],
"name": "GraphQLError",
"originalError": {
"name": "SyntaxError",
"message": "Invalid or unexpected token",
"stack": [
"SyntaxError: Invalid or unexpected token",
" at new Function (<anonymous>)",
" at Object.compileQuery (/PATH/node_modules/graphql-jit/dist/execution.js:70:56)",
" at /PATH/node_modules/@graphql-mesh/utils/index.cjs.js:375:42",
" at executor (/PATH/node_modules/@graphql-mesh/mysql/index.cjs.js:420:20)",
" at processTicksAndRejections (internal/process/task_queues.js:95:5)",
" at async Promise.all (index 0)"
]
},
"source": {
"locationOffset": {}
},
"stack": [
"SyntaxError: Invalid or unexpected token",
" at new Function (<anonymous>)",
" at Object.compileQuery (/PATH/node_modules/graphql-jit/dist/execution.js:70:56)",
" at /PATH/node_modules/@graphql-mesh/utils/index.cjs.js:375:42",
" at executor (/PATH/node_modules/@graphql-mesh/mysql/index.cjs.js:420:20)",
" at processTicksAndRejections (internal/process/task_queues.js:95:5)",
" at async Promise.all (index 0)"
]
}
],
"data": {
"getUsers": null
}
}
Environment:
- OS: macOS Big Sur 11.4
@graphql-mesh/...
:
package.json
{
"dependencies": {
"@graphql-mesh/cli": "^0.30.2",
"@graphql-mesh/mysql": "^0.10.9",
"@graphql-mesh/transform-naming-convention": "^0.6.49",
"@graphql-mesh/transform-rename": "^0.8.19",
"graphql": "^15.5.1"
}
}
- NodeJS: node v14.17.3 (npm v6.14.13)
Metadata
Metadata
Assignees
Labels
No labels