Skip to content

Conversation

@charly-ffss
Copy link
Contributor

Fixes #271
Refs #245

This makes overblog/graphiql-bundle truly optional, as documented.
It allows installing graphqlite-bundle on Symfony 8 without requiring GraphiQL.

@andrew-demb
Copy link
Collaborator

Is it necessary to drop GraphiQL-related classes from the DI container in case of a non-existing dependency?

public function process(ContainerBuilder $container): void
{
$endPointDefinition = new Definition(EndpointResolver::class);
$endPointDefinition->addArgument(new Reference('request_stack'));
$container->setDefinition('overblog_graphiql.controller.graphql.endpoint', $endPointDefinition);
}

@charly-ffss
Copy link
Contributor Author

Is it necessary to drop GraphiQL-related classes from the DI container in case of a non-existing dependency?

public function process(ContainerBuilder $container): void
{
$endPointDefinition = new Definition(EndpointResolver::class);
$endPointDefinition->addArgument(new Reference('request_stack'));
$container->setDefinition('overblog_graphiql.controller.graphql.endpoint', $endPointDefinition);
}

Good point.

Currently, the compiler pass does not reference any Overblog GraphiQL classes directly, so declaring the service alone should not crash even if the bundle is not installed.

That said, now that overblog/graphiql-bundle is optional, it would probably be safer to guard this wiring (e.g. checking bundle presence or class existence) to avoid registering GraphiQL-related services when the dependency is not installed.

I didn’t include this change in the PR since the goal here was limited to making the dependency optional at the Composer level.

@andrew-demb
Copy link
Collaborator

OK, let's merge as is.

Thank you @charly-ffss

@andrew-demb andrew-demb merged commit 069a75c into thecodingmachine:master Dec 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't composer require on symfony 8 (overblog/graphiql-bundle should be optionnal)

2 participants