gql
is a core utility that should be placed before every GraphQL query.
It handles injected parameters under the hood and allows for syntax highlighting and formatting.
import hydrate from '@dpdk/library/utilities/hydrate';
import gql from '@dpdk/library/utilities/gql';
function ReferenceSection({ content_block }) {
return <h1>The queried content block is available directly</h1>;
}
ReferenceSection.getQuery = ({ sectionData }) => gql`{
content_block(filter: { nid: "${sectionData.reference.nid}" }) {
title
}
}`;
Last modified | Monday, August 30, 2021, 2:00:02 PM UTC |
Last author | Colin van Eenige |
Commit ID | fd08685 |