Comments within a GraphQL Query
Comments are annotations embedded in the GraphQL query that serve to explain and document a specific statement making the query easier to understand and maintain.
You can add comments to the GraphQL table function by using the #
symbol. Anything that follows the #
is considered as a comment and
would not be executed.
Example 3-20 Defining Comments in the GraphQL Table Function
SELECT JSON_SERIALIZE(data PRETTY) AS data FROM GRAPHQL('
race (limit: 2) {
id: race_id
name
podium # this field is a JSON object having details of Top 3
date: race_date
}
');
The text this field is a JSON object having details of Top 3
considered
a comment since it is preceded by a # symbol. Adding the comment would not modify or
impact the results generated by the query.