Closed troian closed 4 years ago
It could be that function does not exist (yet) in boilergql please add a PR for missing ones!
Ah in our use case we don't have string id's in database. Are you using UUID as id?
I'm generating ID's for gglgen to keep all ID's unique for Relay.dev based on uints, but that's not needed in your use case. I'll try to look into it as soon as possible.
It could simplify a lot of code if you use string id's!
It could help me a lot if you could send me a part of your database scheme or SQL with a reproduction so I could add it to https://github.com/web-ridge/gqlgen-sqlboiler-examples so your use keeps working with other releases too :)
I can share SQL schema to reproduce the issue but would like to not publish it
Ok no problem I am changing existing schema to string ids to test use-case!
I have a failing reproduction repository: https://github.com/web-ridge/gqlgen-sqlboiler-examples/tree/master/issue-12-string-ids.
It looks like exactly what we've got. Especially formatting :)
I'm almost done with fixes! Code is a lot cleaner when you have string id's 👍.
Another note btw. GraphQL has a special type ID. Is it possible to generate with it instead of string?
type Comment {
id: String!
content: String!
post: Post
user: User!
commentLikes: [CommentLike]
}
turns into
type Comment {
id: ID!
content: String!
post: Post
user: User!
commentLikes: [CommentLike]
}
It should, but it has to do with string id's!
I found the bug for that. Will try to release a new version with support for string id's tomorrow!
Another note btw. GraphQL has a special type ID. Is it possible to generate with it instead of string?
type Comment { id: String! content: String! post: Post user: User! commentLikes: [CommentLike] }
turns into
type Comment { id: ID! content: String! post: Post user: User! commentLikes: [CommentLike] }
This issue is fixed now! https://github.com/web-ridge/sqlboiler-graphql-schema/releases
Ok have most of it fixed at the moment. Still looking into an edge case for batch delete!
Please try v2.0.5 it works now as far I can see! Let me know if you have any issues.
Also for the boilergql package please use latest commit like https://github.com/web-ridge/utils-go/commit/d7c1f34df76959523880e7dd81c73b4bf1d17eb7
So put d7c1f34df76959523880e7dd81c73b4bf1d17eb7 in your go.mod
github.com/web-ridge/utils-go/boilergql d7c1f34df76959523880e7dd81c73b4bf1d17eb7
And run
go mod tidy
Somehow go modules don't understand sub repositories, I need to get a better understanding of this to release these as different packages.
Let me know if I can close this issue!
Example output can be found here: https://github.com/web-ridge/gqlgen-sqlboiler-examples/blob/master/issue-12-string-ids/helpers/convert.go
Will test in a moment. There is one more thing) https://github.com/web-ridge/sqlboiler-graphql-schema/issues/5
ID filter is not working at the moment for your use-case https://github.com/web-ridge/gqlgen-sqlboiler-examples/blob/master/issue-12-string-ids/helpers/filter.go#L39
Will fix that tomorrow it's the only place I think where interfaces are used so linters are not complaining there.
Have this error now
error!!
validation failed: packages.Load: resolver/resolver.go:127:30: RemovedStringID not declared by package boilergql
RemovedIDsToBoilerString not declared by package boilergql
Please try v2.0.5 it works now as far I can see! Let me know if you have any issues.
Also for the boilergql package please use latest commit like web-ridge/utils-go@d7c1f34
So put d7c1f34df76959523880e7dd81c73b4bf1d17eb7 in your go.mod
github.com/web-ridge/utils-go/boilergql d7c1f34df76959523880e7dd81c73b4bf1d17eb7
And run
go mod tidy
Somehow go modules don't understand sub repositories, I need to get a better understanding of this to release these as different packages.
Yes please follow this go modules are not fixed for that package.
I'm going to sleep now :-). Nice that you're trying my package! I'm building some production concepts in it which are not released yet! Th batch update/delete calls are not tested yet but they should work. If you miss anything let me know! Also if it's already on the roadmap.
RemovedIDsToBoilerString
It's there: https://github.com/web-ridge/utils-go/blob/master/boilergql/convert.go#L43 :-D
Closed in favor of new issue: https://github.com/web-ridge/gqlgen-sqlboiler/issues/14
In some cases function itself assigned instead of its result. In other cases it just inserts coma Some referenced functions do not actually exist in
boilergql
packageWe have also failed some difficulties with referencing ID type. For some reason
gqlgen-sqlboiler
generates it asuint
even though in models generated bysqlboiler
it definitely specified asstring
Samples of the issue