Kind: Class
Source: atloria-monorepo/apps/api-schema-parser/src/parsers/graphql.parser.ts
GraphQL Parser Implementation
Supports:
- GraphQL Schema Definition Language (SDL)
- Queries, Mutations, Subscriptions
- Object Types, Input Types, Enums, Interfaces, Unions
- Directives and field arguments
Implements: IParser
Methods
| Method | Signature | Returns |
|---|---|---|
initialize | initialize(config: ParserConfig) | Promise<void> |
canParse | canParse(filePath: string) | boolean |
parseFile | parseFile(filePath: string, content: string) | Promise<ParseResult> |
parseFiles | parseFiles(files: ParseFileInput[]) | Promise<ParseResult[]> |
destroy | destroy() | Promise<void> |
Properties
| Property | Type |
|---|---|
name | any |
version | any |
supportedPatterns | any |
Where it refuses work
GraphQLParserstops the work with an early return whentype instanceof GraphQLNonNull, in 3 places.GraphQLParserstops the work with an early return whentype instanceof GraphQLList, in 2 places.GraphQLParserstops the work with an early return whentypeName.startsWith('__').GraphQLParserstops the work with an early return when['Query', 'Mutation', 'Subscription'].includes(typeName).
When something fails
GraphQLParserhandles failure in 1 place: it turns it into a return value in all 1.
Was this page helpful?