Graphql: Generate Types from struct

Created on 26 Nov 2016  路  6Comments  路  Source: graphql-go/graphql

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.

Most helpful comment

@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

All 6 comments

though it for another package, you may find this helpful.
https://github.com/neelance/graphql-go/issues/28#issuecomment-263068537

@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

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.

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schaze picture schaze  路  4Comments

bbuck picture bbuck  路  4Comments

jiharal picture jiharal  路  5Comments

davejohnston picture davejohnston  路  3Comments

rustysys-dev picture rustysys-dev  路  6Comments