Skip to content

Problem with reusing the same cache entries for differently configured class finders #711

Closed
@andrew-demb

Description

@andrew-demb

I'm in progress of making Symfony bundle thecodingmachine/graphqlite-bundle compatible with thecodingmachine/graphqlite v7.

While upgrading the Symfony bundle codebase, phpunit tests showed a problem with functionality that relies upon adding a custom type mapper factory (\TheCodingMachine\GraphQLite\Mappers\StaticClassListTypeMapperFactory) to the main Schema in dev-master version of graphqlite (dev-master has commits that improved performance and caching of the library #698). The problem was that graphqlite failed to find the GraphQL type, that should have been added by custom type mapper (instantiated via factory).

After investigating, I found the place, where graphqlite while using cache for class finders (\TheCodingMachine\GraphQLite\Discovery\ClassFinder) - doesn't try to change the cache key for different instances of a class finder.

$entries = $this->entries($classFinder, $key . '.entries', $map);

$result = $this->cache->get($key);

I will create a PR that fixes the behavior (but won't reuse the cache for differently configured instances of class finder) with tests.

/cc @oprypkhantc @SCIF

PS: WIP PR for graphqlite-bundle on my fork: andrew-demb/graphqlite-bundle#1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions