UNPKG

622 BTypeScriptView Raw
1interface Location {
2 line: number;
3 column: number;
4}
5
6/**
7 * A representation of source input to GraphQL.
8 * `name` and `locationOffset` are optional. They are useful for clients who
9 * store GraphQL documents in source files; for example, if the GraphQL input
10 * starts at line 40 in a file named Foo.graphql, it might be useful for name to
11 * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`.
12 * line and column in locationOffset are 1-indexed
13 */
14export class Source {
15 body: string;
16 name: string;
17 locationOffset: Location;
18 constructor(body: string, name?: string, locationOffset?: Location);
19}