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

Language Server appears not to start up #220

Closed
3 tasks done
mattpocock opened this issue Feb 21, 2024 · 6 comments
Closed
3 tasks done

Language Server appears not to start up #220

mattpocock opened this issue Feb 21, 2024 · 6 comments

Comments

@mattpocock
Copy link

Describe the bug

I've followed the installation instructions, but the language server doesn't seem to start up. No .d.ts file is created.

I'm using VSCode.

Reproduction

https://github.com/mattpocock/gql-tada-testing

gql.tada version

^1.2.1

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct
@JoviDeCroock
Copy link
Member

JoviDeCroock commented Feb 21, 2024

Hey @mattpocock

Going to move this issue to @0no-co/graphqlsp, are you using the workspace version of VSCode? If so, do you see any logs in the tsserver logs, you can start these up like this and look for [GraphQLSP].

Quickly checked myself and the LSP works but it fails to generate the types due to your schema being invalid.

Err 76    [08:00:44.311] Exception on executing command unknown:

    Unknown type "CreateUserInput".
    
    Unknown type "CreatePostInput".

    Error: Unknown type "CreateUserInput".
    
    Unknown type "CreatePostInput".

When I add

input CreatePostInput {
  id: ID!
}

input CreateUserInput {
  id: ID!
}

It works fine, currently it's really hard to convey errors in the LSP as it just pipes to tsserver which in turn is hard to surface. Sorry you had to run into that.

@JoviDeCroock JoviDeCroock transferred this issue from 0no-co/gql.tada Feb 21, 2024
@kitten
Copy link
Member

kitten commented Feb 21, 2024

I suppose this does add some question around debugging, but I think, the answer here is quite simple: gql.tada should have a CLI that allows doing all the operations we tell people out of the box.

I've also been thinking that for some cases a doctor or check subcommand would be useful that checks several pre-conditions 🤔

@mattpocock
Copy link
Author

Gotcha - yes, this is a hard problem to solve. This flow come up extremely often and it's important to source it to the user.

Is it not possible with the plugin to throw custom errors at certain call sites? Like graphql. Just blow the whole thing up with errors if there's a problem with the schema (or, for instance, fetching from a remote schema?).

@JoviDeCroock
Copy link
Member

We can't surface it no, I have tried a lot of things but I have only managed to surface it in tsserver. We're working on 0no-co/gql.tada#58 to be able to surface these differently

@mattpocock
Copy link
Author

OK, makes sense! I'll close this issue as it feels unrelated to the real problem, which you guys have in hand.

@deathemperor
Copy link

just want to add that folders won't be automatically created so no .d.ts file either

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

No branches or pull requests

4 participants