Skip to content

✖ [client-preset] target output should be a directory, ex: "src/gql/" #8684

Answered by bianpratama
Stevemoretz asked this question in Q&A
Discussion options

You must be logged in to vote

@Stevemoretz

I think you need to add / after the directory key, should be src/gql/ instead of src/gql.

Full code:

import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
    overwrite: true,
    // schema: "http://graphql.test/wp-central/public/lighthouse-schema.graphql",
    // schema: "http://graphql.test/wp-json/central/api/graphql",
    schema: "./lighthouse-schema.graphql",
    documents: "src/**/*.{tsx,ts}",
    // documents: "src/**/*.graphql",
    generates: {
        "src/gql/": {
            // preset: "client",
            plugins: ["typescript"],
            preset: "client",
        },
    },
};

export default config;

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
5 replies
@Stevemoretz
Comment options

@saihaj
Comment options

@Stevemoretz
Comment options

@Stevemoretz
Comment options

@Stevemoretz
Comment options

Comment options

You must be logged in to vote
6 replies
@Stevemoretz
Comment options

@bianpratama
Comment options

@Stevemoretz
Comment options

@bianpratama
Comment options

@Stevemoretz
Comment options

Answer selected by Stevemoretz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants