Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Request/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,9 @@ private function postExecute(ExecutionResult $result, ExecutorArgumentsEvent $ex
Events::POST_EXECUTOR
)->getResult();
}

public function reset(): void
{
$this->schemas = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it wise to reset the schemas for each requests? The schema is not expected to change on the fly is it?

But then maybe the schema should be cached somewhere

}
}
5 changes: 5 additions & 0 deletions src/Resolver/TypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ private function baseType(string $alias): ?Type
return $type;
}

public function reset(): void
{
$this->cache = [];
}

protected function supportedSolutionClass(): ?string
{
return Type::class;
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ services:
calls:
- ["setMaxQueryComplexity", ["%overblog_graphql.query_max_complexity%"]]
- ["setMaxQueryDepth", ["%overblog_graphql.query_max_depth%"]]
tags:
- { name: kernel.reset, method: reset }

Overblog\GraphQLBundle\Definition\Builder\SchemaBuilder:
arguments:
Expand All @@ -37,6 +39,7 @@ services:
- ["setDispatcher", ["@event_dispatcher"]]
tags:
- { name: overblog_graphql.service, alias: typeResolver }
- { name: kernel.reset, method: reset }

Overblog\GraphQLBundle\Transformer\ArgumentsTransformer:
arguments:
Expand Down
Loading