-
Notifications
You must be signed in to change notification settings - Fork 61
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
GraphQL 4: Generated code poisons IDE search #369
Comments
@ScopeyNZ Has raised the idea of using a phar, which would definitely clean up the IDE, but would severely compromise debugability of the generated code. |
If it was controlled by a separate ENV variable whether it produces a phar or standard code, phar being the default. Then for debugging you can switch it around as/when needed. |
Yeah, good point.. how about: interface ClassNameObfuscator
{
public function obfuscateClassname(string $class): string;
} Implementations:
Config:
|
PR is up here: #426 |
Merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because most types are based on models, it's really common that the generated type classes have the same short name as the
DataObject
implementations in the project code. This can be super annoying when searching for something likePage
, because often times the IDE prioritises the generated graphql code class.Proposed solution: Confuse the IDE
We'll never be able to fully remove "Page" from the generated code without handicapping the debugging experience, but what we can do is dirty it to make it less appealing to the IDE.
Because we're not relying on PSR-4 (everything is just
require_once()
in a bespoke function call), we can get away with some nonconventional stuff, here..graphql/default/Page.php
Then just update
AbstractTypeRegistry::fromCache()
:You'd probably still see it, but at least it wouldn't be ranked higher than your actual PSR-4 compliant
Page
class.The text was updated successfully, but these errors were encountered: