Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow schema caching per server when using a common base schema #1224

Open
wants to merge 9 commits into
base: 8.x-4.x
Choose a base branch
from

Conversation

darvanen
Copy link
Contributor

@darvanen darvanen commented Jul 22, 2021

I am NOT by any means suggesting this at the fix approach, it merely shows where the problem lies so a discussion can be had regarding how to fix it.
Updated to a viable patch, though there are other ways we could approach it.

@darvanen
Copy link
Contributor Author

See #1223 for initial notes

@darvanen
Copy link
Contributor Author

I'm sorry, I went to try and create a test to demonstrate this but it's completely beyond me.

@darvanen
Copy link
Contributor Author

Ok, now this PR contains a potential fix using a setter on the plugin to provide the server ID.

We could probably also do it by putting another key on the configuration that gets passed to the plugin but this seemed safer to me.

@darvanen darvanen changed the title 1223-schema-caching demonstrate problem Allow schema caching per server when using a common base schema Jul 23, 2021
@darvanen
Copy link
Contributor Author

Alright I give up. The last test failure is a conflict between PHPStan and phpcs

PHPStan:

 ------ ------------------------------------------------------------------ 
  Line   src/Plugin/SchemaPluginInterface.php                              
 ------ ------------------------------------------------------------------ 
  23     PHPDoc tag @param has invalid value (string                       
           The machine name of the server using this plugin.): Unexpected  
         token "\n   * ", expected variable at offset 84                   
 ------ ------------------------------------------------------------------ 

phpcs:

FILE: ...odules/graphql/src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 47 | ERROR | [x] Do not append variable name "$serverId" to the type
    |       |     declaration in a member variable comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

@darvanen darvanen marked this pull request as ready for review July 23, 2021 02:49
src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php Outdated Show resolved Hide resolved
src/Plugin/SchemaPluginInterface.php Outdated Show resolved Hide resolved
darvanen and others added 3 commits August 5, 2021 19:28
Co-authored-by: Alexander Varwijk <Kingdutch@users.noreply.github.com>
Co-authored-by: Alexander Varwijk <Kingdutch@users.noreply.github.com>
@klausi klausi added the 4.x label Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants