source.d.ts 622 B

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