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

Unknown type "GitHub_Blob". #190

Closed
rajbirjohar opened this issue Feb 12, 2020 · 4 comments
Closed

Unknown type "GitHub_Blob". #190

rajbirjohar opened this issue Feb 12, 2020 · 4 comments

Comments

@rajbirjohar
Copy link

Description

When attempting to get nord-docs running locally, the project ends up compiling successfully but an error occurs at runtime labeled as:

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "GitHub_Blob".

File: src/components/organisms/page/ports/slack/SectionSetup/SectionSetup.jsx:39:18

and this error as well:

ERROR #11321  PLUGIN

"gatsby-source-graphql" threw an error while running the sourceNodes lifecycle:

Response not successful: Received status code 401



  ServerError: Response not successful: Received status code 401
  
  - index.js:23 Object.exports.throwServerError
    [nord-docs]/[apollo-link-http-common]/lib/index.js:23:17
  
  - index.js:48 
    [nord-docs]/[apollo-link-http-common]/lib/index.js:48:21
  
  - task_queues.js:94 processTicksAndRejections
    internal/process/task_queues.js:94:5
  

warn The gatsby-source-graphql plugin has generated no Gatsby nodes. Do you need it?

I have tried to look through the code and I can't seem to understand what the problem is.

Steps to Reproduce

  1. Clone nord-docs master branch release v0.23.0
  2. Run npm install
  3. Run gatsby develop as instructed.

Expected Behavior

Expected behavior is being able to get the project up and running locally.

Actual Behavior

An error occurs at runtime:

Unknown type "GitHub_Blob".

within the slack SectionSetup.jsx.

Environment and Versions

Version of Nord-docs: v0.23.0
Environment: MacOS Catalina 10.15.3
Node version: v12.14.1
NPM version: 6.13.7

## System:
 - OS: macOS 10.15.3
 - CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
 - Memory: 158.39 MB / 8.00 GB
 - Shell: 5.7.1 - /bin/zsh
## Binaries:
 - Node: 12.14.1 - /usr/local/bin/node
 - Yarn: 1.21.1 - /usr/local/bin/yarn
 - npm: 6.13.7 - /usr/local/bin/npm
## IDEs:
 - Atom: 1.40.1
 - Emacs: 26.3 - /usr/local/bin/emacs
 - Nano: 2.0.6 - /usr/bin/nano
 - Sublime Text: Build 3211
 - Vim: 8.1 - /usr/bin/vim
 - Xcode: /undefined - /usr/bin/xcodebuild
## Languages:
 - Bash: 3.2.57 - /bin/bash
 - Java: 13.0.1 - /usr/bin/javac
 - Perl: 5.18.4 - /usr/bin/perl
 - PHP: 7.3.11 - /usr/bin/php
 - Python: 2.7.16 - /usr/bin/python
 - Ruby: 2.6.3 - /usr/bin/ruby
 - Rust: 1.21.1 - /Users/rj/.cargo/bin/rustup

Stack Trace and Error Messages

ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "GitHub_Blob".

File: src/components/organisms/page/ports/slack/SectionSetup/SectionSetup.jsx:39:18

ERROR #11321  PLUGIN

"gatsby-source-graphql" threw an error while running the sourceNodes lifecycle:

Response not successful: Received status code 401



  ServerError: Response not successful: Received status code 401
  
  - index.js:23 Object.exports.throwServerError
    [nord-docs]/[apollo-link-http-common]/lib/index.js:23:17
  
  - index.js:48 
    [nord-docs]/[apollo-link-http-common]/lib/index.js:48:21
  
  - task_queues.js:94 processTicksAndRejections
    internal/process/task_queues.js:94:5
  

warn The gatsby-source-graphql plugin has generated no Gatsby nodes. Do you need it?

Additional Context

Screen Shot 2020-02-12 at 11 49 02

Screen Shot 2020-02-12 at 11 49 19

Potential Solution

This issue seems to stem from line 39 from:

src/components/organisms/page/ports/slack/SectionSetup/SectionSetup.jsx:39:18

I don't have any experience with gatsby or graphQL but I'm eager to learn how to solve this issue.

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Feb 13, 2020

Hi @rjohar014 👋

This repository is still in steadily ongoing development (including breaking changes at any time) and, like described in #1, the main goal is to create a sine-source-of-truth for the Nord project which is why this is kind of a opinionated project and currently not really laid out to be easily usable by others. That's why there is no documentation about this repository and how to build & use it at all.

Anyway, the problem you're facing is the fact that the used gatsby-source-graphql plugin requires an valid GitHub API token in order to fetch data from the GraphQL API. The data is used to display information about all the port project repositories on the ports page like the amount of stars or the latest version as well as linking to the public URL of the repository without “hardcoding“ it into the code base.
The GitHub API token is stored in the both .env files for production & development that are both encrypted using the de-facto standard tool git-crypt (see .git-crypt folder in the repository root).

In order to use the project you need to

  • create a GitHub API token to be able to fetch (public) data from the GraphQL API
  • delete both .env files and replace them with your own ones or use any other package or script to set and expose the required environment variables that contains the GitHub API token. During build time the environment variables named NORD_DOCS_GITHUB_API_TOKEN_READONLY_PUBLIC will be checked for the token, but you can adjust the code to use any other name.
    Please be careful to not expose these publicly but only on your local system, otherwise also encrypt them to store them in a public repository.

Related to #173

@rajbirjohar
Copy link
Author

Thank you for the detailed answer! I really appreciate you taking the time to thoroughly explain what's going on. I'll follow your instructions and should be able to troubleshoot and get it up and running again.

@rajbirjohar
Copy link
Author

rajbirjohar commented Feb 13, 2020

Are you able to point me to a resource that will give a more detailed step-by-step approach as to how to replace .env with my own? I'm not sure what the file is supposed to contain nor how to expose the required environment variables. Thanks.

EDIT: Got it working. Thanks again :)

@arcticicestudio
Copy link
Contributor

You're welcome, nice to to see you got it working 😄
The .env files are loaded using the dotenv package and loaded in the gatsby-config.js file. The files can contain normal (shell) environment variable definitions, e.g.:

GITHUB_TOKEN=XXXXXXX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants