- Issue created by @oknate
- π¦πΊAustralia almunnings Melbourne, π¦πΊ
I did some digging around this with version 3.x of compose.
I'm still not certain I found it.I was booting up the plugin instances on getBaseDefinition, which can sometimes come in partially cached of bypassed if the cache in graphql was "full", which would happen if cache went a bit fucky, from incorrect server_id in the graphql validator path, or possibly from some internal GC.
- Thats the hunch anyway. so I wrote away from it.
https://git.drupalcode.org/project/graphql_compose/-/commit/ca0139f615ee...
I guess we can re-visit this once v3 goes into alpha
- πΊπΈUnited States oknate Greater New York City Area
This might be helpful, I found a way to check if fields are missing:
/** @var \Drupal\graphql\Entity\Server $server */ $server = \Drupal::entityTypeManager() ->getStorage('graphql_server') ->load('graphql_compose_server'); $query = $server->configuration()?->getSchema()?->getConfig()?->getQuery(); $fields_to_check = [ 'route', 'node', etc. ]; $missing_fields = []; foreach ($fields_to_check as $field) { try { $query->getField($field); } catch (InvariantViolation $error) { if (strpos($error->getMessage(), 'Field "' . $field . '" is not defined for type "Query"') !== FALSE) { $missing_fields[] = $field; } } }