GraphiQL API Documentation
    Preparing search index...

    Function fillLeafs

    • Given a document string which may not be valid due to terminal fields not representing leaf values (Spec Section: "Leaf Field Selections"), and a function which provides reasonable default field names for a given type, this function will attempt to produce a schema which is valid after filling in selection sets for the invalid fields.

      Note that there is no guarantee that the result will be a valid query, this utility represents a "best effort" which may be useful within IDE tools.

      Parameters

      • Optionalschema: GraphQLSchema | null
      • OptionaldocString: string
      • OptionalgetDefaultFieldNames: GetDefaultFieldNamesFn

      Returns { insertions: Insertion[]; result: string | undefined }