| 1 |
from typing import TYPE_CHECKING |
| 2 |
|
| 3 |
from .graphql_error import GraphQLError |
| 4 |
|
| 5 |
if TYPE_CHECKING: |
| 6 |
from ..language.source import Source # noqa: F401 |
| 7 |
|
| 8 |
__all__ = ["GraphQLSyntaxError"] |
| 9 |
|
| 10 |
|
| 11 |
class GraphQLSyntaxError(GraphQLError): |
| 12 |
"""A GraphQLError representing a syntax error.""" |
| 13 |
|
| 14 |
def __init__(self, source: "Source", position: int, description: str) -> None: |
| 15 |
super().__init__( |
| 16 |
f"Syntax Error: {description}", source=source, positions=[position] |
| 17 |
) |
| 18 |
self.description = description |