json-to-graphql-query icon indicating copy to clipboard operation
json-to-graphql-query copied to clipboard

Where and how declare fragments?

Open JSsantana opened this issue 2 years ago • 1 comments

I see that ConfigurablePost turns into a fragment, but where and how it should be declared? as a object? as a graphql string? where it should be? inside query property? The docs is not clear.

import { jsonToGraphQLQuery } from 'json-to-graphql-query';

const query = {
    query: {
        Posts: {
            title: true,
            __all_on: [
                "ConfigurablePost",
                "PageInfo"
            ]
        }
    }
};
const graphql_query = jsonToGraphQLQuery(query, { pretty: true });

JSsantana avatar Jul 18 '22 15:07 JSsantana

+1

Howell5 avatar Mar 23 '23 10:03 Howell5