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#GraphQLSchema
- graphql#Kind
- graphql#OperationDefinitionNode
- graphql#SelectionSetNode
- graphql#FieldNode
- graphql#visit
- graphql#ASTNode
- graphql#Location
- graphql#GraphQLError
- graphql#GraphQLInterfaceType
- graphql#GraphQLObjectType
- graphql#GraphQLField
- graphql#ValueNode
- graphql#GraphQLUnionType
- graphql#isAbstractType
- graphql#GraphQLType
- graphql#GraphQLCompositeType
- graphql#isEqualType
- graphql#SchemaMetaFieldDef
- graphql#TypeNameMetaFieldDef
- graphql#GraphQLEnumValue
graphql#TypeMetaFieldDef TypeScript Examples
The following examples show how to use
graphql#TypeMetaFieldDef.
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: graphql.ts From amplify-codegen with Apache License 2.0 | 6 votes |
/**
* Not exactly the same as the executor's definition of getFieldDef, in this
* statically evaluated environment we do not always have an Object type,
* and need to handle Interface and Union types.
*/
export function getFieldDef(
schema: GraphQLSchema,
parentType: GraphQLCompositeType,
fieldAST: FieldNode
): GraphQLField<any, any> | undefined {
const name = fieldAST.name.value;
if (name === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {
return SchemaMetaFieldDef;
}
if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
return TypeMetaFieldDef;
}
if (
name === TypeNameMetaFieldDef.name &&
(parentType instanceof GraphQLObjectType || parentType instanceof GraphQLInterfaceType || parentType instanceof GraphQLUnionType)
) {
return TypeNameMetaFieldDef;
}
if (parentType instanceof GraphQLObjectType || parentType instanceof GraphQLInterfaceType) {
return parentType.getFields()[name];
}
return undefined;
}