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

Preset: resolve absolute path #7055

Merged
merged 2 commits into from
Feb 15, 2022
Merged

Conversation

staff0rd
Copy link
Contributor

@staff0rd staff0rd commented Nov 21, 2021

Developing presets locally fails without this change.

The change is similar to what is already being done in getPluginByName

Without this change

Config:

schema: "https://api.spacex.land/graphql"
generates:
  generated/src:
    preset: dist/my-preset.js

Error on generate:

Unable to find preset matching 'dist/my-preset.js'
    Install one of the following packages:


    - @graphql-codegen/dist/my-preset.js
    - @graphql-codegen/dist/my-preset.js-preset
    - dist/my-preset.js

    Error: Unable to find preset matching dist/my-preset.js
        at getPresetByName (/Users/staffordwilliams/git/graphql-code-generator/packages/graphql-codegen-cli/dist/bin.js:405:11)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
        at async /Users/staffordwilliams/git/graphql-code-generator/packages/graphql-codegen-cli/dist/bin.js:968:47
        at async Task.task (/Users/staffordwilliams/git/graphql-code-generator/packages/graphql-codegen-cli/dist/bin.js:797:17)
    Error: Unable to find preset matching dist/my-preset.js
        at getPresetByName (/Users/staffordwilliams/git/graphql-code-generator/packages/graphql-codegen-cli/dist/bin.js:405:11)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
        at async /Users/staffordwilliams/git/graphql-code-generator/packages/graphql-codegen-cli/dist/bin.js:968:47
        at async Task.task (/Users/staffordwilliams/git/graphql-code-generator/packages/graphql-codegen-cli/dist/bin.js:797:17)

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2021

🦋 Changeset detected

Latest commit: 0eaa477

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

This PR includes changesets to release 2 packages
Name Type
@graphql-codegen/cli Patch
@graphql-cli/codegen Patch

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

@ardatan ardatan force-pushed the master branch 2 times, most recently from 9ea19ea to 7673256 Compare November 24, 2021 23:10
@charlypoly charlypoly self-assigned this Feb 15, 2022
@charlypoly
Copy link
Contributor

Hi @staff0rd,

Thank you for your contribution! ⚡

@charlypoly charlypoly merged commit 1e3d37a into dotansimha:master Feb 15, 2022
BenoitRanque pushed a commit to BenoitRanque/graphql-code-generator that referenced this pull request May 29, 2022
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