public GraphQLTypeReference(String name) { assertValidName(name); this.name = name; }
public Builder typeResolver(String parentTypeName, TypeResolver typeResolver) { typeResolverMap.put(assertValidName(parentTypeName), typeResolver); return this; }
/** * Creates new field coordinates * * @param parentType the container of the field * @param fieldName the field name * * @return new field coordinates represented by the two parameters */ public static FieldCoordinates coordinates(String parentType, String fieldName) { assertValidName(parentType); assertValidName(fieldName); return new FieldCoordinates(parentType, fieldName); }
private GraphQLArgument(String name, String description, GraphQLInputType type, Object defaultValue, Object value, InputValueDefinition definition, List<GraphQLDirective> directives) { assertValidName(name); assertNotNull(type, "type can't be null"); this.name = name; this.description = description; this.type = type; this.defaultValue = defaultValue; this.value = value; this.definition = definition; this.directives = directives; }
public GraphQLDirective(String name, String description, EnumSet<DirectiveLocation> locations, List<GraphQLArgument> arguments, boolean onOperation, boolean onFragment, boolean onField) { assertValidName(name); assertNotNull(arguments, "arguments can't be null"); this.name = name; this.description = description; this.locations = locations; this.arguments.addAll(sortGraphQLTypes(arguments)); this.onOperation = onOperation; this.onFragment = onFragment; this.onField = onField; }
/** * The exception to the general rule is the system __xxxx Introspection fields which have no parent type and * are able to be specified on any type * * @param fieldName the name of the system field which MUST start with __ * * @return the coordinates */ public static FieldCoordinates systemCoordinates(String fieldName) { assertTrue(fieldName.startsWith("__"), "Only __ system fields can be addressed without a parent type"); assertValidName(fieldName); return new FieldCoordinates(null, fieldName); } }
/** * @param name the name * @param description the description * @param value the value * @param deprecationReason the deprecation reasons * @param directives the directives on this type element * * @deprecated use the {@link #newEnumValueDefinition()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLEnumValueDefinition(String name, String description, Object value, String deprecationReason, List<GraphQLDirective> directives) { assertValidName(name); assertNotNull(directives, "directives cannot be null"); this.name = name; this.description = description; this.value = value; this.deprecationReason = deprecationReason; this.directives = directives; }
/** * @param name the name * @param description the description * @param type the field type * @param defaultValue the default value * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newInputObjectField()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLInputObjectField(String name, String description, GraphQLInputType type, Object defaultValue, List<GraphQLDirective> directives, InputValueDefinition definition) { assertValidName(name); assertNotNull(type, "type can't be null"); assertNotNull(directives, "directives cannot be null"); this.name = name; this.type = type; this.defaultValue = defaultValue; this.description = description; this.directives = directives; this.definition = definition; }
/** * @param name the name * @param description the description * @param coercing the coercing function * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newScalar()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLScalarType(String name, String description, Coercing coercing, List<GraphQLDirective> directives, ScalarTypeDefinition definition) { assertValidName(name); assertNotNull(coercing, "coercing can't be null"); assertNotNull(directives, "directives can't be null"); this.name = name; this.description = description; this.coercing = coercing; this.definition = definition; this.directives = directives; }
/** * @param name the name * @param description the description * @param values the values * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newEnum()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLEnumType(String name, String description, List<GraphQLEnumValueDefinition> values, List<GraphQLDirective> directives, EnumTypeDefinition definition) { assertValidName(name); assertNotNull(directives, "directives cannot be null"); this.name = name; this.description = description; this.definition = definition; this.directives = directives; buildMap(sortGraphQLTypes(values)); }
/** * @param name the name * @param description the description * @param type the field type * @param dataFetcherFactory the field data fetcher factory * @param arguments the field arguments * @param deprecationReason the deprecation reason * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newFieldDefinition()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLFieldDefinition(String name, String description, GraphQLOutputType type, DataFetcherFactory dataFetcherFactory, List<GraphQLArgument> arguments, String deprecationReason, List<GraphQLDirective> directives, FieldDefinition definition) { assertValidName(name); assertNotNull(dataFetcherFactory, "you have to provide a DataFetcher (or DataFetcherFactory)"); assertNotNull(type, "type can't be null"); assertNotNull(arguments, "arguments can't be null"); this.name = name; this.description = description; this.type = type; this.dataFetcherFactory = dataFetcherFactory; this.arguments = Collections.unmodifiableList(sortGraphQLTypes(arguments)); this.directives = directives; this.deprecationReason = deprecationReason; this.definition = definition; }
/** * @param name the name * @param description the description * @param fields the fields * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newInputObject()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLInputObjectType(String name, String description, List<GraphQLInputObjectField> fields, List<GraphQLDirective> directives, InputObjectTypeDefinition definition) { assertValidName(name); assertNotNull(fields, "fields can't be null"); assertNotNull(directives, "directives cannot be null"); this.name = name; this.description = description; this.definition = definition; this.directives = directives; buildMap(sortGraphQLTypes(fields)); }
/** * @param name the name * @param description the description * @param types the possible types * @param typeResolver the type resolver function * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newUnionType()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLUnionType(String name, String description, List<GraphQLOutputType> types, TypeResolver typeResolver, List<GraphQLDirective> directives, UnionTypeDefinition definition) { assertValidName(name); assertNotNull(types, "types can't be null"); assertNotEmpty(types, "A Union type must define one or more member types."); assertNotNull(directives, "directives cannot be null"); this.name = name; this.description = description; this.types = sortGraphQLTypes(types); this.typeResolver = typeResolver; this.definition = definition; this.directives = directives; }
/** * @param name the name * @param description the description * @param fieldDefinitions the fields * @param typeResolver the type resolver function * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newInterface()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLInterfaceType(String name, String description, List<GraphQLFieldDefinition> fieldDefinitions, TypeResolver typeResolver, List<GraphQLDirective> directives, InterfaceTypeDefinition definition) { assertValidName(name); assertNotNull(fieldDefinitions, "fieldDefinitions can't null"); assertNotNull(directives, "directives cannot be null"); this.name = name; this.description = description; buildDefinitionMap(sortGraphQLTypes(fieldDefinitions)); this.typeResolver = typeResolver; this.definition = definition; this.directives = directives; }
/** * @param name the name * @param description the description * @param fieldDefinitions the fields * @param interfaces the possible interfaces * @param directives the directives on this type element * @param definition the AST definition * * @deprecated use the {@link #newObject()} builder pattern instead, as this constructor will be made private in a future version. */ @Internal @Deprecated public GraphQLObjectType(String name, String description, List<GraphQLFieldDefinition> fieldDefinitions, List<GraphQLOutputType> interfaces, List<GraphQLDirective> directives, ObjectTypeDefinition definition) { assertValidName(name); assertNotNull(fieldDefinitions, "fieldDefinitions can't be null"); assertNotNull(interfaces, "interfaces can't be null"); this.name = name; this.description = description; this.interfaces = sortGraphQLTypes(interfaces); this.definition = definition; this.directives = assertNotNull(directives); buildDefinitionMap(sortGraphQLTypes(fieldDefinitions)); }
public GraphQLTypeReference(String name) { assertValidName(name); this.name = name; }
/** * Creates new field coordinates * * @param parentType the container of the field * @param fieldName the field name * * @return new field coordinates represented by the two parameters */ public static FieldCoordinates coordinates(String parentType, String fieldName) { assertValidName(parentType); assertValidName(fieldName); return new FieldCoordinates(parentType, fieldName); }
private GraphQLArgument(String name, String description, GraphQLInputType type, Object defaultValue, Object value, InputValueDefinition definition, List<GraphQLDirective> directives) { assertValidName(name); assertNotNull(type, "type can't be null"); this.name = name; this.description = description; this.type = type; this.defaultValue = defaultValue; this.value = value; this.definition = definition; this.directives = directives; }
/** * The exception to the general rule is the system __xxxx Introspection fields which have no parent type and * are able to be specified on any type * * @param fieldName the name of the system field which MUST start with __ * * @return the coordinates */ public static FieldCoordinates systemCoordinates(String fieldName) { assertTrue(fieldName.startsWith("__"), "Only __ system fields can be addressed without a parent type"); assertValidName(fieldName); return new FieldCoordinates(null, fieldName); } }
public GraphQLDirective(String name, String description, EnumSet<DirectiveLocation> locations, List<GraphQLArgument> arguments, boolean onOperation, boolean onFragment, boolean onField) { assertValidName(name); assertNotNull(arguments, "arguments can't be null"); this.name = name; this.description = description; this.locations = locations; this.arguments.addAll(sortGraphQLTypes(arguments)); this.onOperation = onOperation; this.onFragment = onFragment; this.onField = onField; }