UNPKG

@envelop/generic-auth

Version:

This plugin allows you to implement custom authentication flow by providing a custom user resolver based on the original HTTP request. The resolved user is injected into the GraphQL execution `context`, and you can use it in your resolvers to fetch the cu

15 lines (14 loc) 606 B
import { DocumentNode } from 'graphql'; /** * Sanitizes a GraphQL document node by removing empty and unused nodes. * This includes: * - Empty inline fragments * - Fields with empty selection sets * - Fragment spreads referencing empty fragments * - Unused fragment definitions * * The sanitization is performed iteratively until the document stabilizes, * ensuring that cascading cleanups (e.g., removing an empty inline fragment * that causes a parent field to become empty) are handled correctly. */ export declare function removeEmptyOrUnusedNodes(documentNode: DocumentNode): DocumentNode;