This is a small change, but it lets you import marshaler and unmarshalers from the same generated package.
Why?
I'd like to keep all the graphql related code into one. Following the conventions of the genqlient/example, I would like to keep a custom marshaler in the same directory as example. For e.g., example/helper.go could contain:
...
generated: generated.go
package: main
bindings:
DateTime:
type: time.Time
unmarshaler: "https://github.com/Khan/genqlient/main.UnMarshalDateTime" // since package name is main
# unmarshaler: "https://github.com/Khan/genqlient/example.UnMarshalDateTime" // nor this, if one is using a custom package
So, instead I would like to add a new feature where one can import from the same package:
This is a small change, but it lets you import marshaler and unmarshalers from the same generated package.
Why? I'd like to keep all the graphql related code into one. Following the conventions of the
genqlient/example
, I would like to keep a custom marshaler in the same directory asexample
. For e.g.,example/helper.go
could contain:But following won't work:
So, instead I would like to add a new feature where one can import from the same package:
What do you think? If you think this is good, then I will add tests and update the documentation
I have: