private static boolean schemaEquals(SchemaDefinition schema1, SchemaDefinition schema2) { if (schema1 == null) { return schema2 == null; } if (schema1.schema() == null) { return schema2.schema() == null; } if (schema2 != null && schema2.schema() != null) { return schema1.schema().getQueryType().getName().equals(schema2.schema().getQueryType().getName()); } return false; }
/** * Executes a blocking call to the GraphQL query processor and executes the query. * * @param graphqlQuery the graphql query * @param variables the variables to pass to the query * @return the graphql query result */ public QueryResult queryBlocking(String graphqlQuery, JsonObject variables) { Objects.requireNonNull(graphqlQuery, "GraphQL query cannot be null"); GraphQL graphQL = new GraphQL(schema()); ExecutionResult result; if (variables == null) { result = graphQL.execute(graphqlQuery); } else { result = graphQL.execute(graphqlQuery, (Object) null, variables.getMap()); } return convertToQueryResult(result); }
Objects.requireNonNull(graphqlQuery, "GraphQL query cannot be null"); GraphQL graphQL = new GraphQL.Builder(schema()).build();