Search in sources :

Example 1 with AttributeDescriptor

use of org.kie.kogito.persistence.api.proto.AttributeDescriptor in project kogito-apps by kiegroup.

the class GraphQLObjectTypeMapper method getGraphQLType.

private GraphQLOutputType getGraphQLType(AttributeDescriptor attribute, GraphQLSchema schema, Map<String, GraphQLType> additionalTypes, Map<String, DomainDescriptor> allTypes) {
    String typeName = getTypeName(attribute.getTypeName());
    GraphQLType type = schema.getType(typeName);
    if (type == null) {
        type = additionalTypes.computeIfAbsent(typeName, k -> new GraphQLObjectTypeMapper(schema, additionalTypes, allTypes).apply(allTypes.get(typeName)));
    }
    return (GraphQLOutputType) type;
}
Also used : GraphQLObjectType(graphql.schema.GraphQLObjectType) Logger(org.slf4j.Logger) ExtendedScalars(graphql.scalars.ExtendedScalars) LoggerFactory(org.slf4j.LoggerFactory) GraphQLOutputType(graphql.schema.GraphQLOutputType) GraphQLType(graphql.schema.GraphQLType) Function(java.util.function.Function) GraphQLFieldDefinition.newFieldDefinition(graphql.schema.GraphQLFieldDefinition.newFieldDefinition) Consumer(java.util.function.Consumer) AttributeDescriptor(org.kie.kogito.persistence.api.proto.AttributeDescriptor) Scalars(graphql.Scalars) KOGITO_DOMAIN_ATTRIBUTE(org.kie.kogito.index.Constants.KOGITO_DOMAIN_ATTRIBUTE) DomainDescriptor(org.kie.kogito.persistence.api.proto.DomainDescriptor) Map(java.util.Map) GraphQLSchema(graphql.schema.GraphQLSchema) KogitoMetadata(org.kie.kogito.index.model.KogitoMetadata) GraphQLOutputType(graphql.schema.GraphQLOutputType) GraphQLType(graphql.schema.GraphQLType)

Aggregations

Scalars (graphql.Scalars)1 ExtendedScalars (graphql.scalars.ExtendedScalars)1 GraphQLFieldDefinition.newFieldDefinition (graphql.schema.GraphQLFieldDefinition.newFieldDefinition)1 GraphQLObjectType (graphql.schema.GraphQLObjectType)1 GraphQLOutputType (graphql.schema.GraphQLOutputType)1 GraphQLSchema (graphql.schema.GraphQLSchema)1 GraphQLType (graphql.schema.GraphQLType)1 Map (java.util.Map)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 KOGITO_DOMAIN_ATTRIBUTE (org.kie.kogito.index.Constants.KOGITO_DOMAIN_ATTRIBUTE)1 KogitoMetadata (org.kie.kogito.index.model.KogitoMetadata)1 AttributeDescriptor (org.kie.kogito.persistence.api.proto.AttributeDescriptor)1 DomainDescriptor (org.kie.kogito.persistence.api.proto.DomainDescriptor)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1