Skip to content

[R] docs: clarify default GraphQL endpoint for Symfony and Laravel variants #2168

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

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions core/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ To enable GraphQL and its IDE (GraphiQL and GraphQL Playground) in your API, sim
composer require api-platform/graphql
```

You can now use GraphQL at the endpoint: `https://localhost:8443/graphql`.
You can now use GraphQL at the endpoint: `https://localhost/graphql`.

> [!NOTE]
> If you used [the Symfony Variant thanks to Symfony Flex](../symfony/index.md#installing-the-framework) or the Laravel
> variant, URLs will be prefixed with `/api` by default. For example, the GraphQL endpoint will be: `https://localhost:8443/api/graphql`.
> variant, the default GraphQL endpoint will be available at a relative URL like `/graphql`. For example: `https://localhost/graphql`.

## Changing Location of the GraphQL Endpoint

Expand All @@ -33,12 +33,12 @@ Using the Symfony variant we can do this modification by adding the following co
```yaml
# api/config/routes.yaml
api_graphql_entrypoint:
path: /api/graphql
path: /graphql
controller: api_platform.graphql.action.entrypoint
# ...
```

Change `/api/graphql` to the URI you wish the GraphQL endpoint to be accessible on.
Change `/graphql` to the URI you wish the GraphQL endpoint to be accessible on.

### Laravel Routes

Expand All @@ -49,11 +49,11 @@ Using the Laravel variant we can do this modification by adding the following co
use Illuminate\Support\Facades\Route;
use ApiPlatform\GraphQL\Action\EntrypointAction;

Route::post('/api/graphql', EntrypointAction::class)
Route::post('/graphql', EntrypointAction::class)
->name('api_graphql_entrypoint');
```

Change `/api/graphql` to the URI you wish the GraphQL endpoint to be accessible on.
Change `/graphql` to the URI you wish the GraphQL endpoint to be accessible on.

## GraphiQL

Expand Down