Skip to content

Can't edit forked files in the web UI - "Someone edited the file the same time"

When I try to edit https://docs.gitlab.com/ee/api/graphql/getting_started.html and commit it, I get "Someone edited the file the same time you did." every time.

image

The link leads to https://gitlab.com/gitlab-org/gitlab/-/blob/abitrolly-master-patch-51927/doc/api/graphql/getting_started.md which is 404.

Preview doesn't work too - An error occurred previewing the blob.

Steps to reproduce

  1. Click "Edit this page" link leading to https://gitlab.com/gitlab-org/gitlab/blob/master/doc/api/graphql/getting_started.md
  2. Edit it, the URL is https://gitlab.com/gitlab-org/gitlab/-/update/master/doc/api/graphql/getting_started.md
  3. Hit "Commit changes"

Further details

This is the updated content I am trying to save.

### Command line

You can run GraphQL queries from the command line on your local computer using
`curl` or HTTPie. It is done by a `POST` request to `/api/graphql`
with the query as the payload. You can authorize your request by generating a
[personal access token](../../user/profile/personal_access_tokens.md) to use as
a bearer token.
This token requires at least the `read_api` scope.

Example:

```shell
GRAPHQL_TOKEN=<your-token>
curl "https://gitlab.com/api/graphql" --header "Authorization: Bearer $GRAPHQL_TOKEN" \
     --header "Content-Type: application/json" --request POST \
     --data "{\"query\": \"query {currentUser {name}}\"}"
```

To nest strings in the query string,
wrap the data in single quotes or escape the strings with `\\`:

```shell
curl "https://gitlab.com/api/graphql" --header "Authorization: Bearer $GRAPHQL_TOKEN" \
    --header "Content-Type: application/json" --request POST \
    --data '{"query": "query {project(fullPath: \"<group>/<subgroup>/<project>\") {jobs {nodes {id duration}}}}"}'
      # or "{\"query\": \"query {project(fullPath: \\\"<group>/<subgroup>/<project>\\\") {jobs {nodes {id duration}}}}\"}"
```

Example using HTTPie:

```shell
GRAPHQL_TOKEN=<your-token>
http POST "https://gitlab.com/api/graphql" "Authorization:Bearer $GRAPHQL_TOKEN" query="{currentUser {name}}"
```

Note that these tools do not natively support GraphQL pagination and you need to implement it yourself.
Edited by Anatoli Babenia