From aa4b1ae71260720b47695b8a256134f20280f61a Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 21 May 2018 09:52:24 +0200 Subject: Add `present_using` to types By specifying a presenter for the object type, we can keep the logic out of `GitlabSchema`. The presenter gets initialized using the object being presented, and the context (including the `current_user`). --- doc/api/graphql/index.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 doc/api/graphql/index.md (limited to 'doc/api/graphql') diff --git a/doc/api/graphql/index.md b/doc/api/graphql/index.md new file mode 100644 index 00000000000..78e634df347 --- /dev/null +++ b/doc/api/graphql/index.md @@ -0,0 +1,34 @@ +# GraphQL API (Beta) + +> [Introduced][ce-19008] in GitLab 11.0. + +## Enabling the GraphQL feature + +The GraphQL API itself is currently in Beta, and therefore hidden behind a +feature flag. To enable it on your selfhosted instance, run +`Feature.enable(:graphql)`. + +Start the console by running + +```bash +sudo gitlab-rails console +``` + +Then enable the feature by running + +```ruby +Feature.enable(:graphql) +``` + +## Available queries + +A first iteration of a GraphQL API inlcudes only 2 queries: `project` and +`merge_request` and only returns scalar fields, or fields of the type `Project` +or `MergeRequest`. + +## GraphiQL + +The API can be explored by using the GraphiQL IDE, it is available on your +instance on `gitlab.example.com/api/graphiql`. + +[ce-19008]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19008 -- cgit v1.2.1