strange symbols in generated code
- 主要语言
- Go
- 星标
- 10.8k
- 派生
- 1.3k
- 平均合并
- 2 天 36 分钟
- 30 天内合并 PR
- 26
描述
unmarshalN__DirectiveLocation2ᚕstringᚄ
in generated file i can see strange symbols, does it possible to generate code only with standard symbols ?
my schema:
```
directive @AccountService on FIELD_DEFINITION
type Account {
id: String
parent: String
zone: String
status: AccountStatus
login: String
passw: String
type: AccountType
createdAt: Int
updatedAt: Int
deletedAt: Int
info: AccountInfo
metadata: [Account_MetadataEntry!]
}
enum AccountAddress {
ACCOUNT_ADDRESS_UNSPECIFIED
ACCOUNT_ADDRESS_REGISTRATION
ACCOUNT_ADDRESS_CURRENT
ACCOUNT_ADDRESS_CORPORATE
}
type AccountInfo {
name: String
email: String
id: String
contacts: [Contact!]
addresses: [Address!]
}
enum AccountStatus {
ACCOUNT_STATUS_UNSPECIFIED
ACCOUNT_STATUS_DISABLED
ACCOUNT_STATUS_ENABLED
ACCOUNT_STATUS_BLOCKED
ACCOUNT_STATUS_DELETED
}
enum AccountType {
ACCOUNT_TYPE_UNSPECIFIED
ACCOUNT_TYPE_PRIVATE
ACCOUNT_TYPE_CORPORATE
}
type Account_MetadataEntry {
key: String
value: String
}
type Address {
type: AccountAddress
value: String
}
type Contact {
type: ContactType
value: String
}
enum ContactType {
CONTACT_TYPE_UNSPECIFIED
CONTACT_TYPE_EMAIL
CONTACT_TYPE_PHONE
CONTACT_TYPE_MESSENGER
}
input CreateAccountReqInput {
name: String
}
type ListAccountRsp {
accounts: [Account!]
}
type Mutation {
accountServiceCreateAccount(in: CreateAccountReqInput): Boolean @AccountService
accountServiceUpdateAccount: Boolean @AccountService
accountServiceDeleteAccount: Boolean @AccountService
}
type Query {
accountServiceListAccount: ListAccountRsp @AccountService
accountServiceLookupAccount: Boolean @AccountService
}
```
贡献指南
调研方向
这个 issue 涉及从 GraphQL schema 生成的 Go 代码中出现 'ᚕ' 之类的奇怪符号。查看 gqlgen 的代码生成过程,可能需要关注负责生成 unmarshaler 或类型名称的 package。首先使用提供的 schema 重现问题,然后检查生成的文件,确认这些符号是从哪里产生的。检查将 GraphQL 类型名称转换为 Go 标识符的逻辑,可能涉及 Unicode 处理。'Done' 表示生成的代码只使用标准 ASCII 或预期的 Go 标识符字符。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go, graphql
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100