# GraphQL

[GraphQL](https://graphql.org/) is a query language and server-side runtime for application programming interfaces (APIs) that provides exactly the data that the clients request, fetching data from multiple data sources with a single API call.

## Retrieve Kloudfuse FuseQL log data

GraphQL is an in-browser tool for writing, validating, and testing queries. We use it to access log-related data using our proprietary FuseQL query language. For a list of FuseQL API queries supported through the GraphQL client interface, see [FuseQL API for logs](https://docs.kloudfuse.com/platform/4.0.2/query-languages/fuseql/api/).

When you type queries onto the screen, it returns intelligent typeaheads, aware of the current GraphQL type schema, live syntax, and validation errors — all highlighted within the text.

For example, use `graphql-http` to send an HTTP POST request to the endpoint where you mounted the GraphQL server, and pass the FuseQL query as the query field in a JSON payload.

Because FuseQL queries model complex behavior and request objects, you must construct the query to pass complex datatypes as arguments, and return a defined complex data type. See GraphQL instructions on [Passing Arguments](https://www.graphql-js.org/docs/passing-arguments/) and [Object Types](https://www.graphql-js.org/docs/object-types/).

## Syntax notes

- A GraphQL query starts and ends with a {}{} (curly brackets) characters.
- Fields and arguments are of the form `argument: datatype`.
- Lines that start with a ## (hash) are ignored.

## Example

```javascript
{
  field(arg: "value") {
    subField
  }
}
```

## Keyboard shortcuts

Prettify query

`Shift` \+ `Ctrl` \+ `P`

Or, click **Prettify**.

Merge fragments

`Shift` \+ `Ctrl` \+ `M`

Or, click **Merge**.

Run query

`Ctrl` \+ `Enter`

Or, click **Play**.

Auto-complete

`Ctrl` \+ `Space`

Or, start typing.
