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

fix cli schema path resolver #82

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

wyattades
Copy link
Contributor

Summary

npx gql.tada generate is resolving the schema.graphql file path from parent of CWD instead of the CWD.

e.g.

// tsconfig.json
{
  "plugins": [
    {
      "name": "@0no-co/graphqlsp",
      "schema": "./graphql/schema.graphql",
      "tadaOutputLocation": "./types/graphql-env.d.ts"
    }
  ]
}

Assume CWD is /path/to/my_projects/my_app
Run npx gql.tada generate gets error:

Something went wrong while writing the introspection file [Error: ENOENT: no such file or directory, open '/path/to/my_projects/graphql/schema.graphql']

Set of changes

  • remove path.dirname()

NOTE: I would add a test-case but I don't see tests for CLI yet

Copy link

changeset-bot bot commented Feb 26, 2024

🦋 Changeset detected

Latest commit: 4ed303e

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

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

Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

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

Just need a changeset and we're good! Thanks for filing the Pr

@wyattades
Copy link
Contributor Author

Just need a changeset and we're good! Thanks for filing the Pr

@JoviDeCroock added! let me know if I did it wrong

Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
@JoviDeCroock JoviDeCroock merged commit c1756d1 into 0no-co:main Feb 27, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Feb 27, 2024
@wyattades wyattades deleted the wa/fix-schema-path-resolver branch February 27, 2024 15:49
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.

None yet

2 participants