graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.86k stars 838 forks source link

hello all, how can I fetch schema(sdl) at runtime #635

Open younfor opened 2 years ago

younfor commented 2 years ago

because my data schema is dynamic and change at runtime, I can`t just define my sdl during program initialization. is extension a way to solve it ?

bhoriuchi commented 2 years ago

on the client side or server side?

Client Side there is an introspection query that is typically used and included in most client libraries (not sure how up to date this gist is https://gist.github.com/craigbeck/b90915d49fda19d5b2b17ead14dcd6da)

For server side dynamic rebuilding you need to write some code to do that or use something like https://github.com/bhoriuchi/graphql-go-tools#example