Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli/docs]Add GitHub Loader TypeScript type, update usage docs #9332

Merged
merged 2 commits into from
May 15, 2023

Conversation

eddeee888
Copy link
Collaborator

@eddeee888 eddeee888 commented Apr 23, 2023

Description

This PR improves schema Github Loader doc and TypeScript usability:

  • clarifies the two ways of using GitHub Loader in the doc
  • updates TypeScript type of GitHub loader

Related: #9281

Type of change

  • This change requires a documentation update

Screenshots/Sandbox (if appropriate/relevant):

Preview of updated doc

Screenshot 2023-04-23 at 9 28 44 pm

Using token no longer triggers TS errors

Screenshot 2023-04-23 at 9 38 23 pm

How Has This Been Tested?

  • Use alpha version in a repo

Test Environment:

  • OS: MacOS
  • NodeJS: 18

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@changeset-bot
Copy link

changeset-bot bot commented Apr 23, 2023

🦋 Changeset detected

Latest commit: 003e725

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/plugin-helpers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@eddeee888 eddeee888 requested review from saihaj and ardatan April 23, 2023 11:31
@github-actions
Copy link
Contributor

diff --git a/website/algolia-lockfile.json b/website/algolia-lockfile.json
index ed978e0b9..aa1a240da 100644
--- a/website/algolia-lockfile.json
+++ b/website/algolia-lockfile.json
@@ -533,7 +533,7 @@
         "anchor": "custom-schema-loader"
       }
     ],
-    "content": "2741d5131dc2271008489e0448732efe",
+    "content": "e915dbb1de2cd152d6847b91fdb643c0",
     "url": "https://www.the-guild.dev/graphql/codegen/docs/config-reference/schema-field",
     "domain": "https://www.the-guild.dev/graphql/codegen",
     "hierarchy": [

@github-actions
Copy link
Contributor

github-actions bot commented Apr 23, 2023

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-codegen/plugin-helpers 4.2.1-alpha-20230424084132-003e725fb npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Apr 23, 2023

💻 Website Preview

The latest changes are available as preview in: https://3ad03f6b.graphql-code-generator.pages.dev

@eddeee888 eddeee888 force-pushed the update-github-loader-docs branch from 646309f to 3b1b47a Compare April 23, 2023 11:42
@@ -183,6 +183,10 @@ export namespace Types {
'apollo-engine': ApolloEngineOptions;
}

export interface GitHubSchemaOptions {
[githubProtocol: string]: { token: string };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github:${string} Do you think this works better?

Copy link
Collaborator Author

@eddeee888 eddeee888 Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that 👍 However, looks like the website GH actions can only generate json schema for number or string index.

Example failed build: https://github.com/dotansimha/graphql-code-generator/actions/runs/4784244922/jobs/8505729237?pr=9332

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ardatan @saihaj, should we leave this as string until typescript-json-schema is fixed upstream?

@eddeee888 eddeee888 force-pushed the update-github-loader-docs branch from 699b68f to 003e725 Compare April 24, 2023 08:39
@saihaj saihaj merged commit f46803a into master May 15, 2023
@saihaj saihaj deleted the update-github-loader-docs branch May 15, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants