Skip to content

Commit af55884

Browse files
committed
fix(analyzer): allowing passing a parsed query
Signed-off-by: Fatih Acar <[email protected]>
1 parent 24d5fba commit af55884

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

infrahub_sdk/analyzer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ class GraphQLOperation(BaseModel):
3030

3131

3232
class GraphQLQueryAnalyzer:
33-
def __init__(self, query: str, schema: GraphQLSchema | None = None) -> None:
33+
def __init__(self, query: str, schema: GraphQLSchema | None = None, document: DocumentNode | None = None) -> None:
3434
self.query: str = query
3535
self.schema: GraphQLSchema | None = schema
36-
self.document: DocumentNode = parse(self.query)
36+
self.document: DocumentNode = document or parse(self.query)
3737
self._fields: dict | None = None
3838

3939
@property

0 commit comments

Comments
 (0)