@Test public void testValidSyntax() throws Exception { ContentHandle content = resourceToContentHandle("graphql-valid.graphql"); GraphQLContentValidator validator = new GraphQLContentValidator(); validator.validate(ValidityLevel.SYNTAX_ONLY, content); }
@Override public void validate(ValidityLevel level, ContentHandle content) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { new SchemaParser().parse(content.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for GraphQL artifact.", e); } } }
GraphQLContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle content) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { new SchemaParser().parse(content.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for GraphQL artifact.", e); } } } }
GraphQLContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle content) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { new SchemaParser().parse(content.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for GraphQL artifact.", e); } } } GraphQLContentValidator(); }
GraphQLContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle content) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { new SchemaParser().parse(content.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for GraphQL artifact.", e); } } } GraphQLContentValidator(); @Override void validate(ValidityLevel level, ContentHandle content); }
GraphQLContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle content) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { new SchemaParser().parse(content.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for GraphQL artifact.", e); } } } GraphQLContentValidator(); @Override void validate(ValidityLevel level, ContentHandle content);  }