({
path,
pointer,
content,
options,
}: {
path: string;
pointer: string;
content: string;
options: T;
})
| 9 | * @internal |
| 10 | */ |
| 11 | export function parse<T extends GraphQLParseOptions>({ |
| 12 | path, |
| 13 | pointer, |
| 14 | content, |
| 15 | options, |
| 16 | }: { |
| 17 | path: string; |
| 18 | pointer: string; |
| 19 | content: string; |
| 20 | options: T; |
| 21 | }): Source | void { |
| 22 | if (/\.(gql|graphql)s?$/i.test(path)) { |
| 23 | return parseGraphQLSDL(pointer, content, options); |
| 24 | } |
| 25 | |
| 26 | if (/\.json$/i.test(path)) { |
| 27 | return parseGraphQLJSON(pointer, content, options); |
| 28 | } |
| 29 | } |
searching dependent graphs…