Skip to content

calling from package.json #21

@idkjs

Description

@idkjs

I am trying to get reenv to run my graphql introspection command.

I cant seem to call it from the package.json script and then pass the value to the command.

Some of the things I have tried.

This works but I can't seem to get past it:

❯ reenv -e .env  printenv REACT_APP_SERVER_URL 
http://localhost:4000/graphql

These doesn't work:

> reenv -e .env get-graphql-schema $REACT_APP_SERVER_URL -j > graphql_schema.json

reenv: unknown option `-j'.
❯ reenv -e .env npx get-graphql-schema $REACT_APP_SERVER_URL -j
reenv: unknown option `-j'.
Usage: reenv [OPTION]... COMMAND [ARGS]...
Try `reenv --help' for more information.

The examples not using reenv work.

{
"get-schema-url": "reenv -e .env printenv REACT_APP_SERVER_URL",
    "get-schema-url-flag": "reenv -e .env -- ls printenv REACT_APP_SERVER_URL",
    "get-schema": "ENDPOINT_URL=$(npm run get-schema-url) get-graphql-schema ENDPOINT_URL -j > graphql_schema.json",
    "introspection-reenv": "get-graphql-schema $(npm run get-schema-url) -j > graphql_schema.json",
    "introspection": "get-graphql-schema http://localhost:4000/graphql -j > graphql_schema.json",
    "introspection:gql": "get-graphql-schema http://localhost:4000/graphql > schema.graphql"
  },

Thank you, sir.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions