Created
November 20, 2017 04:22
-
-
Save nwillc/c0e64a00db1d9f783a344a75bc72011b to your computer and use it in GitHub Desktop.
Loading the Schema IDL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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