MCPcopy
hub / github.com/graphql/graphql-js / toJSON

Method toJSON

src/language/ast.ts:177–189  ·  view source on GitHub ↗

* Returns a JSON representation of this token. * @returns The JSON-serializable representation. * @example * ```ts * import { Lexer, Source } from 'graphql/language'; * * const lexer = new Lexer(new Source('{ hello }')); * const token = lexer.advance().toJSON(); * * token;

()

Source from the content-addressed store, hash-verified

175 * ```
176 */
177 toJSON(): {
178 kind: TokenKind;
179 value?: string;
180 line: number;
181 column: number;
182 } {
183 return {
184 kind: this.kind,
185 value: this.value,
186 line: this.line,
187 column: this.column,
188 };
189 }
190}
191
192/** The list of all possible AST node types. */

Callers 2

toJSONDeepFunction · 0.45
formatObjectValueFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected