@vektah, it does say so in that document:
"This id should be a globally unique identifier for this object, and given just this id, the server should be able to refetch the object."
"If a query returns an object that implements Node, then this root field should refetch the identical object when value returned by the server in the Node‘s id field is passed as the id parameter to the node root field."
It doesn't explicitly say that it needs to identify the type, but it needs to be globally unique, so where would be a better way to put it, and also guarantee global uniqueness, especially if using a regular db and primary keys :)
And, if I recall correctly, that is how the relay package for js does ;)
Hi I'm looking to use the feature introduced in 99designs/gqlgen#375. I am forced to use a single version of mapstucture
(the latest) and it has caused errors in slices_test.go
. gqlgen
is on an older version, upgrading mapstructure
in gqlgen
will break the tests. The code asserts Test1 []string
and Test3 []*string
should resolve to nil
and []
respectively. The newer version of mapstructure will return nil
for all or []
for all depending on the value of ZeroFields
.
Does this test have anything to do with the feature (always use pointers in resolver return types)? Do you know what errors having the different versions might cause?
Any suggestions on splitting generated.go into smaller files? I have a repo with a 256kB size restriction per file.
Render() function at https://github.com/99designs/gqlgen/blob/master/codegen/templates/templates.go#L61 looked like the code that can be refactored to split a single generated.go into multiple files. However, looking at a generated.go file for one query, biggest region is field.topl and this region alone can cross 256KB.
1: 21 // region ** generated!.gotpl **
2: 1666 // region * args.gotpl *
3: 1726 // region ** directives.gotpl **
4: 1730 // region ** field.gotpl *
5: 7009 // region ** input.gotpl *
6: 7031 // region ** interface.gotpl *
7: 7035 // region ** object.gotpl **
8: 8348 // region * type.gotpl *