diff options
Diffstat (limited to 'doc/api/graphql/getting_started.md')
-rw-r--r-- | doc/api/graphql/getting_started.md | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/doc/api/graphql/getting_started.md b/doc/api/graphql/getting_started.md index 57d7880988b..237c0cc6934 100644 --- a/doc/api/graphql/getting_started.md +++ b/doc/api/graphql/getting_started.md @@ -1,6 +1,6 @@ --- stage: Manage -group: Integrations +group: Import and Integrate info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments --- @@ -16,9 +16,9 @@ the API itself. The examples documented here can be run using: -- The command line. -- GraphiQL. -- Rails console. +- [Command line](#command-line). +- [GraphiQL](#graphiql). +- [Rails console](#rails-console). ### Command line @@ -79,6 +79,7 @@ If you are running GitLab 12.0, enable the `graphql` GraphQL queries can be run in a [Rails console session](../../administration/operations/rails_console.md#starting-a-rails-console-session). For example, to search projects: ```ruby +current_user = User.find_by_id(1) query = <<~EOQ query securityGetProjects($search: String!) { projects(search: $search) { @@ -182,7 +183,7 @@ Mutations generally use InputTypes and variables, neither of which appear here. Mutations have: -- Inputs. For example, arguments, such as which emoji you'd like to award, +- Inputs. For example, arguments, such as which emoji reaction you'd like to add, and to which object. - Return statements. That is, what you'd like to get back when it's successful. - Errors. Always ask for what went wrong, just in case. @@ -285,6 +286,24 @@ We've asked for the note details, but it doesn't exist anymore, so we get `null` More about mutations: [GraphQL Documentation](https://graphql.org/learn/queries/#mutations). +### Update project settings + +You can update multiple project settings in a single GraphQL mutation. +This example is a workaround for [the major change](../../update/deprecations.md#default-cicd-job-token-ci_job_token-scope-changed) +in `CI_JOB_TOKEN` scoping behavior. + +```graphql +mutation DisableCI_JOB_TOKENscope { + projectCiCdSettingsUpdate(input:{fullPath: "<namespace>/<project-name>", inboundJobTokenScopeEnabled: false, jobTokenScopeEnabled: false}) { + ciCdSettings { + inboundJobTokenScopeEnabled + jobTokenScopeEnabled + } + errors + } +} +``` + ### Introspective queries Clients can query the GraphQL endpoint for information about its own schema. |