unions

Contents

Used to create custom unions

Usage

Add definitions to the unions property returned by your extension function. Each key is the name of a GraphQL type. The referenced object types must also exist in the schema; replace GraphQLTypeNameOne and GraphQLTypeNameTwo with your type names.

import type {Extensions, GraphQL} from '@enonic-types/guillotine';

export const extensions = (graphQL: GraphQL): Extensions => {
    return {
        unions: {
            CustomUnion: {
                description: "Custom Union",
                types: [
                    graphQL.reference('GraphQLTypeNameOne'),
                    graphQL.reference('GraphQLTypeNameTwo'),
                ]
            }
        }
    };
};

Contents

Contents