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

[Github Marketplace App] Failing to load the source schema #1447

Closed
madiodio opened this issue Apr 22, 2020 · 5 comments
Closed

[Github Marketplace App] Failing to load the source schema #1447

madiodio opened this issue Apr 22, 2020 · 5 comments
Labels
🐞 bug Something isn't working 📦 released This issue or pull request is released

Comments

@madiodio
Copy link

madiodio commented Apr 22, 2020

Hi there, first would like to say this is a wonderful tool.

Just tried to install the Github Marketplace but it's failing on the build with:
Failed to complete schema check
ERROR: Failed to load 'schema.graphql' (ref: *)

This seems like it cannot find the file schema.graphql which is weird because the file exists in the root folder.

I wonder if this is due to having multiple environments set up. I unfortunately can't put together a repo to reproduce because of the structure of the project but tried my best to reproduce the gist of the config that I have.

  • .graphql-inspector.yaml
schema: "schema.graphql"

notifications:
  slack: "<Slack webhook url>"

env:
  production:
    branch: "master"
    endpoint:
      url: "<production endpoint url>"
      method: "POST"
    diff:
      failOnBreaking: true
  development:
    branch: "develop"
    endpoint:
      url: "<development endpoint url>"
      method: "POST"
  • .package.json
...
"scripts:' {
	"generate:schema": "graphql-inspector introspect \"./lib/**/*.graphql\" --write schema.graphql"
}
...
  • Branches on the repo : both develop and master exist with the same schema.graphql generated at the root.

Let me know if you need additional details.

Update:
I dig in the codebase and found this is what's throwing

const failure = new Error(`Failed to load '${path}' (ref: ${ref})`);

Does the presence of the * in (ref: *) means it can't find the targeted branch ?

@madiodio madiodio changed the title [Github Marketplace App ] Failing to load the source schema [Github Marketplace App] Failing to load the source schema Apr 22, 2020
@kamilkisiela
Copy link
Owner

@madiodio It's still experimental but I'm glad you're using it :))

* shows up as a branch (ref) if the target branch of the Pull Request is different than branches in env.<env-name>.branch but that's only used internally. It should use PR's branch and the target branch anyway. It seems like we've got a bug :(

Few questions.

  1. Where do you keep graphql-inspector.yml file?
  2. When does the issue occurs? Is it a PR or commit? What is the target branch?

@kamilkisiela
Copy link
Owner

#1448 should fix it

@kamilkisiela kamilkisiela added 🐞 bug Something isn't working ⚙️ work in progress Someone is working on it labels Apr 23, 2020
@madiodio
Copy link
Author

Ah didn't know it was experimental.

  1. graphql-inspector.yml is inside the root .github folder as shown in the docs

  2. It's interestingly working on a PR but still failing on a commit or anything on the target branches. I have 2 target branches develop and master as stated in the issues.

Thanks for reacting to this so quickly. Looking forward to contributing to this project.

@kamilkisiela
Copy link
Owner

@madiodio fix deployed, try to check now

@madiodio
Copy link
Author

@kamilkisiela Wonderful, it works now.

@kamilkisiela kamilkisiela added 📦 released This issue or pull request is released and removed ⚙️ work in progress Someone is working on it labels Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 released This issue or pull request is released
Projects
None yet
Development

No branches or pull requests

2 participants