Skip to content
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

Merge schema language PR #3

Closed
norcalli opened this issue Nov 29, 2016 · 6 comments
Closed

Merge schema language PR #3

norcalli opened this issue Nov 29, 2016 · 6 comments

Comments

@norcalli
Copy link

After using the macros to define the schema, is it possible to retrieve the schema as a json document? A simple string would suffice. This would allow us to use a tool to automatically version the API using an external tool to analyze the schema.

@mhallin
Copy link
Member

mhallin commented Nov 29, 2016

Hello!

You can use the introspection query from https://github.com/graphql/graphiql/blob/master/src/utility/introspectionQueries.js#L15 to get a JSON representation of the schema. Either fire up a server with Iron and use the built-in GraphiQLHandler and GraphQLHandler or embed the query string in you application directly.

@mhallin mhallin closed this as completed Jan 6, 2017
@SOF3
Copy link

SOF3 commented Jul 13, 2019

I want to export the schema to the graphql client modules, but the graphql_client crate requires it in .graphql format. Is it possible to print it as .graphql format?

@arturh85
Copy link

In his recent talk @LegNeato had a code example at https://youtu.be/QXJ0wKBLt-8?t=1377 that does not seem to be implemented:

let schema = RootNode::new(Query, EmptyMutation::<()>::new());
println!("{}", schema.as_schema_language());

I cannot find this function anywhere, but it would be nice to have.

@davidpdrsn
Copy link
Contributor

I believe this PR has the functionality #324

@LegNeato
Copy link
Member

LegNeato commented Feb 17, 2020

Sorry, been lagging on merging it. Will get to it!

@LegNeato LegNeato reopened this Feb 17, 2020
@LegNeato LegNeato changed the title Print out derived schema? Merge schema language PR Feb 17, 2020
@LegNeato
Copy link
Member

LegNeato commented Jun 6, 2020

This has been merged.

@LegNeato LegNeato closed this as completed Jun 6, 2020
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