github-schema 1.0.0 → 1.1.1

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.
package/README.md CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  > GitHub's GraphQL Schema
4
4
 
5
- <br/>
6
- <br/>
7
-
8
5
  ## 📦 Installation
9
6
 
10
7
  ```sh
@@ -12,8 +9,9 @@ npm install github-schema
12
9
  ```
13
10
 
14
11
  ## 📚 Usage
12
+
15
13
  ```ts
16
- import { gql } from "github-schema";
14
+ import { gql, gqlTyped } from "github-schema";
17
15
 
18
16
  // we are also exporting a ton of types from the graphql schema.
19
17
 
@@ -38,9 +36,24 @@ const REPOSITORY_QUERY = gql`
38
36
  `;
39
37
  ```
40
38
 
39
+ > [!NOTE]
40
+ > If you want to use `gql` with return type of `DocumentNode` you can do something like this:
41
+
42
+ ```ts
43
+ import { gqlTyped } from "github-schema";
44
+ ```
45
+
46
+ ## Editor Autocompletion
47
+
48
+ > [!NOTE]
49
+ > You will need to have [GraphQL LSP](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) installed, and have a `.graphqlrc.yaml` file in your project root.
50
+ > If you also want nice colors, i would recommend [GraphQL Syntax Highlighting](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql-syntax) installed.
51
+
41
52
  ```yaml
42
53
  # .graphqlrc.yaml
43
54
  schema: node_modules/github-schema/schema.graphql
44
55
  ```
45
56
 
46
- Published under [MIT License](./LICENCE).
57
+ ## 📄 License
58
+
59
+ Published under [MIT License](./LICENSE).
@@ -0,0 +1,6 @@
1
+ // src/raw.ts
2
+ function gql(raw, ...keys) {
3
+ return keys.length === 0 ? raw[0] : String.raw({ raw }, ...keys);
4
+ }
5
+
6
+ export { gql };
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+