• /
  • Log in
  • Start now

ngql

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

Usage

import { ngql } from 'nr1'

Examples

Example 1

1
import { ngql } from 'nr1';
2
3
const query = ngql`
4
{
5
actor {
6
user {
7
id
8
email
9
name
10
}
11
}
12
}
13
`;
14
15
function render() {
16
return <NerdGraphQuery query={query}>// ...</NerdGraphQuery>;
17
}
Edit this pageCreate an issue
Copyright © 2021 New Relic Inc.

This site uses cookies 🍪

We use cookies and other similar technologies ("Cookies") on our websites and services to enhance your experience and to provide you with relevant content. By using our websites and services you are agreeing to the use of cookies. You can read more here. If you consent to our cookies, please click Yes.