Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created November 20, 2017 04:22
Show Gist options
  • Save nwillc/c0e64a00db1d9f783a344a75bc72011b to your computer and use it in GitHub Desktop.
Save nwillc/c0e64a00db1d9f783a344a75bc72011b to your computer and use it in GitHub Desktop.
Loading the Schema IDL
final SchemaParser schemaParser = new SchemaParser();
final TypeDefinitionRegistry registry;
try (final InputStream inputStream =
getClass().getClassLoader().getResourceAsStream("schema.graphqls");
final InputStreamReader streamReader = new InputStreamReader(inputStream)) {
registry = schemaParser.parse(streamReader);
} catch (Exception e) {
throw new IllegalStateException("Could not parse graphql schema", e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment