source.d.ts 666 B

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