# GraphQLParser

**Kind:** Class

**Source:** [`atloria-monorepo/apps/api-schema-parser/src/parsers/graphql.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api-schema-parser/src/parsers/graphql.parser.ts#L57)

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

- `GraphQLParser` stops the work with an early return when `type instanceof GraphQLNonNull`, in 3 places.
- `GraphQLParser` stops the work with an early return when `type instanceof GraphQLList`, in 2 places.
- `GraphQLParser` stops the work with an early return when `typeName.startsWith('__')`.
- `GraphQLParser` stops the work with an early return when `['Query', 'Mutation', 'Subscription'].includes(typeName)`.

## When something fails

- `GraphQLParser` handles failure in 1 place: it turns it into a return value in all 1.
