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

请问字段可否支持多语言 Can the field support multiple languages? #3933

Open
Duanxs opened this issue Jul 7, 2023 · 2 comments
Open

Comments

@Duanxs
Copy link

Duanxs commented Jul 7, 2023

目前,Graphql 不支持中文字段,使用上略有不便。像 mysql、mongoDB 均支持多语言字段名,希望 Graphql 也跟进,以方便全球各语言用户。

machine translation:
Currently, Graphql does not support Chinese fields, which is slightly inconvenient. Like mysql and mongoDB, they support multilingual field names, and I hope that Graphql will follow suit to facilitate users in various languages around the world.

报错样例:

type 用户 {
    姓名: String!
}
GraphQLError: Syntax Error: Unexpected character: U+7528.
    at syntaxError (/path/node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/error/syntaxError.js:15:10)
    at readNextToken (/path/node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/lexer.js:420:28)
...
@saihaj
Copy link
Member

saihaj commented Jul 7, 2023

@alex-kinokon
Copy link

alex-kinokon commented Jul 12, 2023

The main issue has been open for 8 years so I wouldn’t count on it.

Edit: If you don’t mind a hacky approach, you can use this patch.

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

No branches or pull requests

4 participants
@alex-kinokon @Duanxs @saihaj and others