Files
madbase/control-plane-ui/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts
Vlad Durnea cffdf8af86
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
wip:milestone 0 fixes
2026-03-15 12:35:42 +02:00

63 lines
1.4 KiB
TypeScript

import { Source } from '../language/source';
/**
* Strips characters that are not significant to the validity or execution
* of a GraphQL document:
* - UnicodeBOM
* - WhiteSpace
* - LineTerminator
* - Comment
* - Comma
* - BlockString indentation
*
* Note: It is required to have a delimiter character between neighboring
* non-punctuator tokens and this function always uses single space as delimiter.
*
* It is guaranteed that both input and output documents if parsed would result
* in the exact same AST except for nodes location.
*
* Warning: It is guaranteed that this function will always produce stable results.
* However, it's not guaranteed that it will stay the same between different
* releases due to bugfixes or changes in the GraphQL specification.
*
* Query example:
*
* ```graphql
* query SomeQuery($foo: String!, $bar: String) {
* someField(foo: $foo, bar: $bar) {
* a
* b {
* c
* d
* }
* }
* }
* ```
*
* Becomes:
*
* ```graphql
* query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}
* ```
*
* SDL example:
*
* ```graphql
* """
* Type description
* """
* type Foo {
* """
* Field description
* """
* bar: String
* }
* ```
*
* Becomes:
*
* ```graphql
* """Type description""" type Foo{"""Field description""" bar:String}
* ```
*/
export declare function stripIgnoredCharacters(source: string | Source): string;