Code Monkey home page Code Monkey logo

Comments (3)

charklewis avatar charklewis commented on August 15, 2024 2

I have managed to find that when running the get-graphql-schema in Github Actions it is adding the script as the first line of the file. I can remove this via an additional script, but unsure why it is being added?

Resulting schema.graphql

$ /home/runner/work/<company-name>/<app-name>/node_modules/.bin/relay-compiler --schema schema.graphql --src src
schema {
  query: query_root
  mutation: mutation_root
  subscription: subscription_root
}
...

This doesn't occur locally instead, I get the following (as expected).

schema {
  query: query_root
  mutation: mutation_root
  subscription: subscription_root
}
...

from get-graphql-schema.

rasulomaroff avatar rasulomaroff commented on August 15, 2024

I have managed to find that when running the get-graphql-schema in Github Actions it is adding the script as the first line of the file. I can remove this via an additional script, but unsure why it is being added?

Resulting schema.graphql

$ /home/runner/work/<company-name>/<app-name>/node_modules/.bin/relay-compiler --schema schema.graphql --src src
schema {
  query: query_root
  mutation: mutation_root
  subscription: subscription_root
}
...

This doesn't occur locally instead, I get the following (as expected).

schema {
  query: query_root
  mutation: mutation_root
  subscription: subscription_root
}
...

Hi there! Could you explain how you managed to delete that first line that broke everything, please?. Have the same issue.

from get-graphql-schema.

MarceloPrado avatar MarceloPrado commented on August 15, 2024

There is a cleaner way to remove the "first line that breaks everything". When you run yarn run X, yarn wraps the output of your script with a header and a footer - the header is what breaks your script.

There's a silent flag you can add that fixes this issue:

scripts: {
  "print-schema": "yarn -s get-graphql-schema http://localhost:3000/graphql > ./data/schema.graphql",
}

From Yarn docs:

-s, --silent skip Yarn console logs, other types of logs (script output) will be printed

from get-graphql-schema.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.