graphql APIs
- GraphQLSchema
- DocumentNode
- GraphQLScalarType
- GraphQLObjectType
- GraphQLError
- buildSchema
- GraphQLResolveInfo
- parse
- GraphQLNonNull
- Kind
- GraphQLString
- GraphQLNamedType
- OperationDefinitionNode
- GraphQLEnumType
- GraphQLList
- GraphQLInputObjectType
- GraphQLInt
- GraphQLFloat
- GraphQLUnionType
- graphql
- GraphQLInterfaceType
- GraphQLField
- GraphQLBoolean
- getIntrospectionQuery
- FieldNode
- SelectionNode
- GraphQLOutputType
- printSchema
- GraphQLType
- SelectionSetNode
- Source
- buildClientSchema
- execute
- DefinitionNode
- FieldDefinitionNode
- isNonNullType
- validate
- isObjectType
- OperationTypeNode
- buildASTSchema
- GraphQLArgument
- visit
- ASTNode
- TypeNode
- NameNode
- NamedTypeNode
- isListType
- DirectiveNode
- StringValueNode
- isScalarType
- isInterfaceType
- ValueNode
- ExecutionResult
- GraphQLInputType
- TypeInfo
- visitWithTypeInfo
- ObjectTypeDefinitionNode
- ArgumentNode
- VariableDefinitionNode
- NonNullTypeNode
- Location
- FragmentDefinitionNode
- extendSchema
- specifiedDirectives
- getOperationAST
- validateSchema
- getNamedType
- GraphQLID
- isUnionType
- isInputObjectType
- GraphQLInputField
- subscribe
- ASTVisitor
- TypeDefinitionNode
- InterfaceTypeDefinitionNode
- VariableNode
- EnumTypeDefinitionNode
- InputValueDefinitionNode
- InlineFragmentNode
- ListTypeNode
- ValidationRule
- introspectionFromSchema
- defaultFieldResolver
- GraphQLFieldResolver
- IntrospectionField
- lexicographicSortSchema
- concatAST
- IntrospectionQuery
- isAbstractType
- GraphQLFieldConfigMap
- GraphQLFieldConfig
- GraphQLSchemaConfig
- GraphQLObjectTypeConfig
- printType
- isSpecifiedScalarType
- isEnumType
- GraphQLEnumValue
- specifiedRules
- GraphQLFieldMap
- GraphQLFormattedError
- ExecutableDefinitionNode
- ObjectTypeExtensionNode
- InterfaceTypeExtensionNode
- DirectiveDefinitionNode
- EnumTypeExtensionNode
- InputObjectTypeDefinitionNode
- InputObjectTypeExtensionNode
- TokenKind
- Token
- Lexer
- EnumValueNode
- ListValueNode
- BooleanValueNode
- BREAK
- GraphQLEnumTypeConfig
- GraphQLInputFieldConfigMap
- GraphQLFieldConfigArgumentMap
- GraphQLInterfaceTypeConfig
- GraphQLInputObjectTypeConfig
- GraphQLEnumValueConfigMap
- GraphQLTypeResolver
- isLeafType
- valueFromASTUntyped
- typeFromAST
- isCompositeType
- GraphQLCompositeType
- isType
- isEqualType
- SchemaMetaFieldDef
- TypeMetaFieldDef
- TypeNameMetaFieldDef
- NoUnusedFragmentsRule
- ValidationContext
- parseValue
- ExecutionArgs
- FormattedExecutionResult
- GraphQLEnumValueConfig
- TypeKind
- IntrospectionInputObjectType
- IntrospectionInputTypeRef
- IntrospectionInputValue
- IntrospectionListTypeRef
- IntrospectionNamedTypeRef
- IntrospectionNonNullTypeRef
- IntrospectionTypeRef
- IntrospectionType
- IntrospectionObjectType
- isNamedType
- assertValidSchema
Other Related APIs
- graphql#Kind
- graphql#DefinitionNode
- graphql#DocumentNode
- graphql#OperationDefinitionNode
- graphql#SelectionSetNode
- graphql#FieldNode
- graphql#TypeInfo
- graphql#ASTNode
- graphql#TypeNode
- graphql#ExecutableDefinitionNode
- graphql#NameNode
- graphql#TypeDefinitionNode
- graphql#FieldDefinitionNode
- graphql#ObjectTypeExtensionNode
- graphql#ObjectTypeDefinitionNode
- graphql#SelectionNode
- graphql#VariableNode
- graphql#ArgumentNode
- graphql#NamedTypeNode
- graphql#VariableDefinitionNode
- graphql#ListTypeNode
graphql#NonNullTypeNode TypeScript Examples
The following examples show how to use
graphql#NonNullTypeNode.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From amplify-codegen with Apache License 2.0 | 6 votes |
compileOperation(operationDefinition: OperationDefinitionNode): Operation {
if (!operationDefinition.name) {
throw new Error('Operations should be named');
}
const filePath = filePathForNode(operationDefinition);
const operationName = operationDefinition.name.value;
const operationType = operationDefinition.operation;
const variables = (operationDefinition.variableDefinitions || []).map(node => {
const name = node.variable.name.value;
const type = typeFromAST(this.schema, node.type as NonNullTypeNode);
this.addTypeUsed(getNamedType(type as GraphQLType));
return { name, type: type as GraphQLNonNull<any> };
});
const source = print(operationDefinition);
const rootType = getOperationRootType(this.schema, operationDefinition) as GraphQLObjectType;
const selectionSet = this.compileSelectionSet(operationDefinition.selectionSet, rootType);
this.addTypeUsed(getNamedType((selectionSet.selections[0] as Field).type)); // store result type
return {
filePath,
operationName,
operationType,
variables,
source,
rootType,
selectionSet,
};
}
Example #2
Source File: gqlTypes.ts From ra-data-prisma with MIT License | 5 votes |
nonNullType = (
type: NamedTypeNode | ListTypeNode,
): NonNullTypeNode => ({
kind: Kind.NON_NULL_TYPE,
type,
})