thecodingmachine / graphqlite-bundle

A Symfony bundle for thecodingmachine/graphqlite.
34 stars 37 forks source link

Dumping schema: `Cannot create schema: no namespace for types found` #158

Closed smilesrg closed 1 year ago

smilesrg commented 1 year ago

It seems there's a problem with the "symfony/dependency-injection": "^5.4" and the bundle while dumping schma using bin/console graphqlite:dump-schema:

In SchemaFactory.php line 395:

  Cannot create schema: no namespace for types found (You must call the SchemaFactory::addTypeNamespace() at least once). 

ref: https://github.com/thecodingmachine/graphqlite/issues/541

smilesrg commented 1 year ago

The compiler pass GraphQLiteCompilerPass is not proceeding. What could be the reason?

smilesrg commented 1 year ago

Even extension GraphQLiteExtension seems not being loaded

amelia-jacyno commented 1 year ago

This seems to be the change causing it: https://github.com/symfony/dependency-injection/commit/58f2988128d2d278280781db037677a32cf720db#diff-9d584e939647584064ecaad604456078cfda5f765f85f7928a3bd0a131f6b169L448

Bringing back the continue on $edge->isLazy() (which as far as I can tell just reverses all the changes) seems to fix it, though I'm not familiar with Symfony internals so I don't really know what's the exact cause here.

smilesrg commented 1 year ago

@JacynoAdam do you think the graphqlite:dump-schema command can be fixed somehow?

amelia-jacyno commented 1 year ago

@smilesrg For now I just version locked symfony/dependency-injection to version 5.4.16, might add a patch that just reverts that one commit later on, to keep updates but also have the command working.

I'm just hoping someone will fix it in this Bundle or on Symfony's side in the near future.

andrew-demb commented 1 year ago

Did you check if it works with 5.4.18?

This issue seems to be related to the problem https://github.com/symfony/symfony/issues/48895

smilesrg commented 1 year ago

@JacynoAdam Thanks for your help! After downgrading to symfony/dependency-injection:5.4.16 the error has been fixed. @andrew-demb there is no 5.4.18 version released yet, however, upgrading to 5.4.x-dev also fixed the error

amelia-jacyno commented 1 year ago

I believe Andrew meant symfony/symfony:5.4.18 which does seem to be fixing this error, but I'm using the symfony/dependency-injection which does seem to fix it in 5.4.x-dev so I'll just be waiting for next stable release.