@conduit-client/onestore-graphql-parser 5.67.0-dev1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * strips Document node and nested definitions of location references, tests only.
3
+ */
4
+ export declare function stripLocation(node: any): any;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Exposes a tagged template literal to parse graphql operation string
3
+ * "gql" is the only publicly exposed method
4
+ * @module gql
5
+ */
6
+ import type { DefinitionNode, DocumentNode } from 'graphql/language';
7
+ export type AstResolver = (astReference: any) => DocumentNode | undefined;
8
+ /**
9
+ * we should look into optimizing this before it turns into a memory hog
10
+ * weakmaps, or limiting the size of the cache, or something
11
+ */
12
+ export declare const docMap: Map<string, DocumentNode>;
13
+ /**
14
+ * Opaque reference map to return keys to userland
15
+ * As a user shouldn't have access to the Document
16
+ */
17
+ export declare const referenceMap: WeakMap<Object, DocumentNode>;
18
+ /**
19
+ * Returns document node if cached or else update the cache and return the document node
20
+ * @param inputString - operation string
21
+ * @returns DocumentNode
22
+ */
23
+ export declare function parseDocument(inputString: string): DocumentNode | null;
24
+ export declare function updateReferenceMapWithKnownKey(doc: DocumentNode, key: object): void;
25
+ export declare function updateReferenceMapAndGetKey(doc: DocumentNode): object;
26
+ /**
27
+ * Insert string and fragment substitutions with the actual nodes
28
+ * @param inputString
29
+ * @param substitutions - string | fragment DocumentNode
30
+ * @returns { operation string, fragment docs [] }
31
+ */
32
+ export declare function processSubstitutions(inputString: ReadonlyArray<string>, substitutions: (string | object)[]): {
33
+ operationString: string;
34
+ fragments: DefinitionNode[];
35
+ } | null;
36
+ /**
37
+ *
38
+ * @param astReference - ast reference passed from user land
39
+ */
40
+ export declare const astResolver: AstResolver;
41
+ /**
42
+ *
43
+ * @param literals - operation query string
44
+ * @param subs - all other substitutions
45
+ * @returns an opaque reference to the parsed document
46
+ */
47
+ export declare function gql(literals: ReadonlyArray<string> | string, ...subs: (string | object)[]): object | null;
@@ -0,0 +1,6 @@
1
+ export type { GraphQLObjectType, GraphQLInterfaceType, GraphQLDirective, GraphQLUnionType, GraphQLNamedType, } from 'graphql/type';
2
+ export type { ASTNode, ObjectValueNode, ListTypeNode, BooleanValueNode, EnumTypeDefinitionNode, FieldDefinitionNode, FloatValueNode, InterfaceTypeDefinitionNode, IntValueNode, NamedTypeNode, ObjectTypeDefinitionNode, StringValueNode, TypeNode, UnionTypeDefinitionNode, DocumentNode, OperationDefinitionNode, FieldNode, ArgumentNode, ValueNode, SelectionNode, SelectionSetNode, FragmentDefinitionNode, DirectiveNode, ObjectFieldNode, ScalarTypeDefinitionNode, InputObjectTypeDefinitionNode, InlineFragmentNode, FragmentSpreadNode, VariableDefinitionNode, ListValueNode, VariableNode, NullValueNode, } from 'graphql/language';
3
+ export { Kind } from 'graphql/language';
4
+ export { gql, astResolver } from './gql';
5
+ export type { AstResolver } from './gql';
6
+ export { parse, print, visit } from 'graphql/language';