HoudiniGraphql / houdini

The disappearing GraphQL framework
http://www.houdinigraphql.com
MIT License
917 stars 99 forks source link

warning returned by vscode svelte extensions #160

Closed YoungiiJC closed 2 years ago

YoungiiJC commented 3 years ago

First off, thx for releasing such an awesome tool @AlecAivazis !

So I'm getting a graphql.buildSchema is not a function error on my script tags in sveltekit:

Screen Shot 2021-08-22 at 10 52 41 AM

I'm new to the $directory generation thing... so I'm unsure how to debug this. Let me know what files are useful here (if any), and I'll share them.

Here's my package.json:

{
    "name": "jobdescriptions.fyi",
    "version": "0.0.1",
    "scripts": {
        "dev": "svelte-kit dev",
        "build": "svelte-kit build",
        "preview": "svelte-kit preview",
        "check": "svelte-check --tsconfig ./tsconfig.json",
        "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
        "lint": "prettier --ignore-path .gitignore  --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
        "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
        "codegen": "npx houdini generate --pull-schema && graphql-codegen --config codegen.yml"
    },
    "devDependencies": {
        "@sveltejs/adapter-static": "^1.0.0-next.16",
        "@sveltejs/kit": "next",
        "@typescript-eslint/eslint-plugin": "^4.19.0",
        "@typescript-eslint/parser": "^4.19.0",
        "eslint": "^7.22.0",
        "eslint-config-prettier": "^8.1.0",
        "eslint-plugin-svelte3": "^3.2.0",
        "houdini": "^0.10.4",
        "houdini-preprocess": "^0.10.4",
        "prettier": "~2.2.1",
        "prettier-plugin-svelte": "^2.2.0",
        "svelte": "^3.34.0",
        "svelte-check": "^2.0.0",
        "svelte-preprocess": "^4.7.4",
        "tslib": "^2.0.0",
        "typescript": "^4.0.0",
        "vite-plugin-windicss": "^1.2.7"
    },
    "type": "module",
    "dependencies": {}
}

and houdini.config.js:

/** @type {import('houdini').ConfigFile} */
const config = {
    schemaPath: 'schema/schema.gql',
    sourceGlob: 'src/**/*.svelte',
    module: 'esm',
    framework: 'kit',
    apiUrl: \*some url *\
}

export default config
AlecAivazis commented 3 years ago

Hey @YoungiiJC - happy to hear that you are liking houdini.

This error looks like an issue in the vs-code extension. Does your actual application work as expected? I get kind of a similar error in the example app so I suspect there is some config we are missing

YoungiiJC commented 3 years ago

SvelteKit is broadly pretty buggy so hard to say... but I think you are correct this is a config thing.

skrenes commented 3 years ago

As a note, if using Code-Server, switch to the VSX extensions or even Microsoft ones. That caused my extensions to be upgraded to the latest versions and these kinds of error disappeared.

AlecAivazis commented 2 years ago

Wow not sure how I missed you saying that @skrenes but thanks for the heads up! I'm going to close this since we seem to have a solution