Skip to content

Generate Types from struct #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SDkie opened this issue Nov 26, 2016 · 6 comments
Open

Generate Types from struct #171

SDkie opened this issue Nov 26, 2016 · 6 comments

Comments

@SDkie
Copy link

SDkie commented Nov 26, 2016

I was planning to build one helper package which will generate types from struct.
Anyone has tried it before?
I am new to graphql, any suggestions will be helpful.
Thanks.

@bsr203
Copy link

bsr203 commented Nov 26, 2016

though it for another package, you may find this helpful.
graph-gophers/graphql-go#28 (comment)

@SDkie
Copy link
Author

SDkie commented Nov 27, 2016

@sogko, @chris-ramon, @bbuck : Have you guys seen following packages?
https://github.com/arvitaly/go-graphql-tools
https://github.com/xinhuang327/gographer

They are doing the work using reflection.
I am planning to write a generator package like https://github.com/mholt/binding

cc @arvitaly @xinhuang327

@base698
Copy link

base698 commented Dec 17, 2016

is there a way to do something like this:

schema := ParseSchema(type Person { name String! }

It says there is a schema parser in the readme but I see no examples anywhere of it.

@incu6us
Copy link

incu6us commented Dec 21, 2016

I've finished a basic generator for graphql using reflect package. You can find it here:
https://github.com/incu6us/gostruct2graphql

@ThundR67
Copy link

I have a created a generator which generate it in runtime
https://github.com/SonicRoshan/straf

@cescoferraro
Copy link

at work we might need that in the near future, so I wrote this package
it works straight out of the box for 99% of our packages usecases
https://github.com/cescoferraro/structql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants