Class GraphQLSchemaInitializerImpl
java.lang.Object
se.liu.ida.hefquin.engine.wrappers.graphql.impl.GraphQLSchemaInitializerImpl
- All Implemented Interfaces:
GraphQLSchemaInitializer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Pair<String,
GraphQLFieldType> determineTypeInformation
(org.apache.jena.atlas.json.JsonObject field) Parses introspection data to determine information about a specific GraphQL field.protected static GraphQLQuery
initializeSchema
(String url, int connectionTimeout, int readTimeout) protected Map<String,
Map<GraphQLEntrypointType, GraphQLEntrypoint>> parseEntrypoints
(org.apache.jena.atlas.json.JsonObject data) Initializes GraphQLEntrypoints by parsing the __schema/queryType parts of the json.protected Map<String,
Map<String, GraphQLField>> parseTypesAndFields
(org.apache.jena.atlas.json.JsonObject data) Initializes the available GraphQL types and fields received from the response.protected GraphQLSchema
validateTypesAndEntrypoints
(Map<String, Map<String, GraphQLField>> typesAndFields, Map<String, Map<GraphQLEntrypointType, GraphQLEntrypoint>> entrypoints) Removes the types, fields and entrypoints from the @param typesAndFields and @param entrypoints and notes their removal if they don't meet the criteria for the approach.
-
Field Details
-
iSchema
- See Also:
-
iName
- See Also:
-
iKind
- See Also:
-
iType
- See Also:
-
iTypes
- See Also:
-
iOfType
- See Also:
-
iFields
- See Also:
-
iQueryType
- See Also:
-
iQueryArgs
- See Also:
-
iSubscriptionType
- See Also:
-
iMutationType
- See Also:
-
schemaPath
- See Also:
-
typePath1
- See Also:
-
typePath2
- See Also:
-
typePath3
- See Also:
-
queryTypePath1
- See Also:
-
queryTypePath2
- See Also:
-
queryTypePath3
- See Also:
-
queryTypeArgsPath1
- See Also:
-
queryTypeArgsPath2
- See Also:
-
ofTypePath
- See Also:
-
subscriptionPath
- See Also:
-
mutationPath
- See Also:
-
-
Constructor Details
-
GraphQLSchemaInitializerImpl
public GraphQLSchemaInitializerImpl()
-
-
Method Details
-
initializeSchema
public GraphQLSchema initializeSchema(String url, int connectionTimeout, int readTimeout) throws GraphQLException, org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException - Specified by:
initializeSchema
in interfaceGraphQLSchemaInitializer
- Throws:
GraphQLException
org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException
-
getIntrospectionQuery
- Returns:
- the GraphQL introspection query to be used.
-
validateTypesAndEntrypoints
protected GraphQLSchema validateTypesAndEntrypoints(Map<String, Map<String, GraphQLField>> typesAndFields, Map<String, Map<GraphQLEntrypointType, GraphQLEntrypoint>> entrypoints) Removes the types, fields and entrypoints from the @param typesAndFields and @param entrypoints and notes their removal if they don't meet the criteria for the approach. (each type needs an id field etc.) -
determineTypeInformation
protected Pair<String,GraphQLFieldType> determineTypeInformation(org.apache.jena.atlas.json.JsonObject field) throws org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException Parses introspection data to determine information about a specific GraphQL field.- Returns:
- a Pair consisting of the GraphQL valuetype (not including list and/or non-nullable identifiers) and GraphQLFieldType respectively for the GraphQL type. @param field is a JsonObject and should contain the keys: "name", "kind" and alternatively "ofType"
- Throws:
org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException
-
parseEntrypoints
protected Map<String,Map<GraphQLEntrypointType, parseEntrypointsGraphQLEntrypoint>> (org.apache.jena.atlas.json.JsonObject data) throws org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException Initializes GraphQLEntrypoints by parsing the __schema/queryType parts of the json.- Throws:
org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException
-
parseTypesAndFields
protected Map<String,Map<String, parseTypesAndFieldsGraphQLField>> (org.apache.jena.atlas.json.JsonObject data) throws org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException Initializes the available GraphQL types and fields received from the response.- Throws:
org.apache.jena.atlas.json.io.parserjavacc.javacc.ParseException
-