• /
  • EnglishEspañol日本語한국어Português
  • EntrarComeçar agora

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

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>
);
}
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.