---
title: ngql
source: https://docs.newrelic.com/docs/new-relic-solutions/build-nr-ui/sdk-component/platform-apis/ngql
---

A JavaScript template literal tag that parses GraphQL query strings into GraphQL documents that can be used to do NerdGraph queries.

### Usage

```jsx
import { ngql } from 'nr1'
```

### Examples

#### Example 1

```jsx
import { ngql } from "nr1";

const query = ngql`
  {
    actor {
      user {
        id
        email
        name
      }
    }
  }
`;

function render() {
  return (
    <NerdGraphQuery query={query}>
      {({ data }) => JSON.stringify(data, null, 2)}
    </NerdGraphQuery>
  );
}
```
