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

fix(laravel): disable GraphQL by default and fix provider #6585

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Sep 5, 2024

Q A
Branch? main
Tickets n/a
License MIT
Doc PR n/a

Prevents a crash when GraphQL isn't installed, which is the default.

@dunglas dunglas requested a review from soyuka September 5, 2024 17:46
@dunglas dunglas force-pushed the fix/laravel-graphql branch from 97306f2 to 749138a Compare September 5, 2024 17:47
Comment on lines +1095 to +1099
if ($config->get('api-platform.graphql.enabled')) {
$fieldsBuilder = $this->app->make(FieldsBuilderEnumInterface::class);
$typeBuilder = $this->app->make(ContextAwareTypeBuilderInterface::class);
$typeBuilder->setFieldsBuilderLocator(new ServiceLocator(['api_platform.graphql.fields_builder' => $fieldsBuilder]));
}
Copy link
Member Author

@dunglas dunglas Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended @soyuka? it looks like $typeBuilderis unused. Is it maybe a rest of something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're in the boot method, this is to handle a circular dependency between the FieldsBuilder and theTypeBuilder of graphql...

@dunglas dunglas merged commit 1b6e7c6 into api-platform:main Sep 5, 2024
57 of 59 checks passed
@dunglas dunglas deleted the fix/laravel-graphql branch September 5, 2024 19:29
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.

2 participants