graphql-go / graphql-go/graphql
Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "database/sql.NullString" does not
- Dominant language
- Go
- Stars
- 10.1k
- Forks
- 845
- PR merge metrics
- No merged PRs in 30d
Description
Hi, Graphql-go
Great library.
I found one issue.
Please find the detail of issue.
In my graphql object I have following fields
"SenderID": &graphql.Field{
Type: graphql.NewScalar(graphql.ScalarConfig{Name: "database/sql.NullString"}),
Description: "The Senderid of the Address.",
},
Here Name field has `/` and `.` because my SenderID is of type database/sql.NullString and hence
At the time of creating Schema I am getting below error
>ERROR: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "database/sql.NullString" does not
graphql/definiation.go at line number 1333 has regx
> var NameRegExp, _ = regexp.Compile("^[_a-zA-Z][_a-zA-Z0-9]*$")
As per this regx database/sql.NullString is not valid name. I updated this regx to `^[_a-zA-Z][_a-zA-Z0-9./]*$` and issue get resolved, I am able to perform query operation.
Could you please incorporate this fix,
Note: model is auto generated using xo and graphql objects are auto generated from model using graphql-go-generate
Contributor guide
Assessment
This issue has not been assessed yet.