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#print
- graphql#Kind
- graphql#DocumentNode
- graphql#OperationDefinitionNode
- graphql#SelectionSetNode
- graphql#SelectionNode
- graphql#GraphQLOutputType
- graphql#GraphQLNamedType
- graphql#GraphQLError
- graphql#FragmentDefinitionNode
- graphql#GraphQLObjectType
- graphql#isAbstractType
- graphql#getNamedType
- graphql#GraphQLInputType
- graphql#GraphQLFieldConfig
- graphql#GraphQLType
- graphql#isEnumType
- graphql#typeFromAST
- graphql#isCompositeType
- graphql#GraphQLCompositeType
graphql#isSpecifiedScalarType TypeScript Examples
The following examples show how to use
graphql#isSpecifiedScalarType.
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: barePrefix.ts From graphql-mesh with MIT License | 6 votes |
transformSchema(schema: GraphQLSchema) {
return mapSchema(schema, {
[MapperKind.TYPE]: (type: GraphQLNamedType) => {
if (this.includeTypes && !isSpecifiedScalarType(type)) {
const currentName = type.name;
if (!this.ignoreList.includes(currentName)) {
return renameType(type, this.prefix + currentName);
}
}
return undefined;
},
[MapperKind.ROOT_OBJECT]() {
return undefined;
},
...(this.includeRootOperations && {
[MapperKind.COMPOSITE_FIELD]: (
fieldConfig: GraphQLFieldConfig<any, any>,
fieldName: string,
typeName: string
) => {
return !rootOperations.has(typeName) || // check we're in a root Type
this.ignoreList.includes(typeName) || // check if type is to be ignored
this.ignoreList.includes(`${typeName}.${fieldName}`) // check if field in type is to be ignored
? undefined // do not perform any change
: [`${this.prefix}${fieldName}`, fieldConfig]; // apply prefix
},
}),
});
}
Example #2
Source File: index.ts From amplify-codegen with Apache License 2.0 | 6 votes |
addTypeUsed(type: GraphQLType) {
if (this.typesUsedSet.has(type)) return;
if (
isEnumType(type) ||
isUnionType(type) ||
isInputObjectType(type) ||
isInterfaceType(type) ||
isObjectType(type) ||
(isScalarType(type) && !isSpecifiedScalarType(type))
) {
this.typesUsedSet.add(type);
}
if (isInterfaceType(type) || isUnionType(type)) {
for (const concreteType of this.schema.getPossibleTypes(type)) {
this.addTypeUsed(getNamedType(concreteType));
}
}
if (isInputObjectType(type)) {
for (const field of Object.values(type.getFields())) {
this.addTypeUsed(getNamedType(field.type));
}
}
if (isObjectType(type)) {
for (const fieldType of type.getInterfaces()) {
this.addTypeUsed(getNamedType(fieldType));
}
for (const field of Object.values(type.getFields())) {
this.addTypeUsed(getNamedType(field.type));
}
}
}