Skip to content

Commit 6271e56

Browse files
committed
docs(file-upload): move from core to symfony and update
1 parent 4461006 commit 6271e56

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

admin/file-upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Handling File Upload
22

3-
If you need to handle the file upload in the server part, please follow [the related documentation](../core/file-upload.md).
3+
If you need to handle the file upload in the server part, please follow [the related documentation](../symfony/file-upload.md).
44

55
This documentation assumes you have a `/media_objects` endpoint accepting `multipart/form-data`-encoded data.
66

core/graphql.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ composer require api-platform/graphql
1919
You can now use GraphQL at the endpoint: `https://localhost:8443/graphql`.
2020

2121
> [!NOTE]
22-
> If you used [the Symfony Variant thanks to Symfony Flex](../symfony/index.md#using-symfony-flex-and-composer-advanced-users) or the Laravel variant, URLs will be prefixed with `/api` by default. For example, the GraphQL endpoint will be: `https://localhost:8443/api/graphql`.
22+
> If you used [the Symfony Variant thanks to Symfony Flex](../symfony/index.md#installing-the-framework) or the Laravel
23+
> variant, URLs will be prefixed with `/api` by default. For example, the GraphQL endpoint will be: `https://localhost:8443/api/graphql`.
2324
2425
## Changing Location of the GraphQL Endpoint
2526

@@ -138,7 +139,7 @@ api_platform:
138139
### Disable GraphQL Playground with Laravel
139140

140141
> [!WARNING]
141-
> This is not yet available with Laravel, you're welcome to contribute [on Github](github.com/api-platform/core)
142+
> This is not yet available with Laravel, you're welcome to contribute [on GitHub](https://github.com/api-platform/core)
142143

143144
### Add another Location for GraphQL Playground
144145

@@ -1100,7 +1101,7 @@ resources:
11001101

11011102
### Syntax for Filters with a List of Key / Value Arguments
11021103

1103-
Some filters like the [exists filter](filters.md#exists-filter) or the [order filter](filters.md#order-filter-sorting) take a list of key / value as arguments.
1104+
Some filters like the [exists filter](doctrine-filters.md#exists-filter) or the [order filter](doctrine-filters.md#order-filter-sorting) take a list of key / value as arguments.
11041105

11051106
The first syntax coming to mind to use them is to write:
11061107

@@ -1387,7 +1388,7 @@ resources:
13871388

13881389
</code-selector>
13891390

1390-
Once enabled, a `page` filter will be available in the collection query (its name [can be changed in the configuration](pagination.md)) and an `itemsPerPage` filter will be available too if [client-side-pagination](pagination.md#client-side) is enabled.
1391+
Once enabled, a `page` filter will be available in the collection query (its name [can be changed in the configuration](pagination.md)) and an `itemsPerPage` filter will be available too if [client-side-pagination](pagination.md#disabling-the-pagination-client-side) is enabled.
13911392

13921393
A `paginationInfo` field can be queried to obtain the following information:
13931394

@@ -2812,7 +2813,7 @@ final class BookContextBuilder implements SerializerContextBuilderInterface
28122813
## Export the Schema in SDL
28132814

28142815
> [!WARNING]
2815-
> This command is not yet available with Laravel, you're welcome to contribute [on Github](github.com/api-platform/core)
2816+
> This command is not yet available with Laravel, you're welcome to contribute [on GitHub](https://github.com/api-platform/core)
28162817

28172818
You may need to export your schema in SDL (Schema Definition Language) to import it in some tools.
28182819

@@ -2828,9 +2829,10 @@ Since the command prints the schema to the output if you don't use the `-o` opti
28282829
bin/console api:graphql:export > path/in/host/schema.graphql
28292830
```
28302831

2831-
## Handling File Upload
2832+
## Handling File Upload with Symfony
28322833

2833-
Please follow the [file upload documentation](file-upload.md), only the differences will be documented here.
2834+
If you use Symfony, please follow the [file upload documentation](../symfony/file-upload.md), only the differences
2835+
will be documented here.
28342836

28352837
The file upload with GraphQL follows the [GraphQL multipart request specification](https://github.com/jaydenseric/graphql-multipart-request-spec).
28362838

outline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ chapters:
99
- testing
1010
- debugging
1111
- caddy
12+
- file-upload
1213
- title: "API Platform for Laravel"
1314
path: laravel
1415
items:
@@ -59,7 +60,6 @@ chapters:
5960
- elasticsearch
6061
- controllers
6162
- events
62-
- file-upload
6363
- jwt
6464
- user
6565
- form-data

core/file-upload.md renamed to symfony/file-upload.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Handling File Upload
22

3-
As common a problem as it may seem, handling file upload requires a custom
4-
implementation in your app. This page will guide you in handling file upload in
5-
your API, with the help of
6-
[VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle). It is
7-
recommended you [read the documentation of
8-
VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle/blob/master/docs/index.md)
3+
As common a problem as it may seem, handling file upload requires a custom implementation in your app. This page will
4+
guide you in handling file upload in your API, with the help of[VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle).
5+
It is recommended you [read the documentation of VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle/blob/master/docs/index.md)
96
before proceeding. It will help you get a grasp on how the bundle works, and why we use it.
107

11-
**Note**: Uploading files won't work in `PUT` or `PATCH` requests, you must use `POST` method to upload files.
12-
See [the related issue on Symfony](https://github.com/symfony/symfony/issues/9226) and [the related bug in PHP](https://bugs.php.net/bug.php?id=55815) talking about this behavior.
8+
> [!NOTE]
9+
> Uploading files won't work in `PUT` or `PATCH` requests, you must use `POST` method to upload files.
10+
> See [the related issue on Symfony](https://github.com/symfony/symfony/issues/9226) and
11+
> [the related bug in PHP](https://bugs.php.net/bug.php?id=55815) talking about this behavior.
1312
1413
Enable the multipart format globally in order to use it as the input format of your resource:
1514

@@ -137,7 +136,7 @@ Note: From V3.3 onwards, `'multipart/form-data'` must either be including in the
137136
Returning the plain file path on the filesystem where the file is stored is not useful for the client, which needs a
138137
URL to work with.
139138

140-
A [normalizer](serialization.md#normalization) could be used to set the `contentUrl` property:
139+
A [normalizer](../core/serialization.md#normalization) could be used to set the `contentUrl` property:
141140

142141
```php
143142
<?php

0 commit comments

Comments
 (0)