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

📎 GraphQL support #1927

Closed
3 tasks done
ematipico opened this issue Feb 27, 2024 · 10 comments
Closed
3 tasks done

📎 GraphQL support #1927

ematipico opened this issue Feb 27, 2024 · 10 comments
Assignees
Labels
Fund S-Funding Status: open to funding and implemented by external contributors S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@ematipico
Copy link
Member

ematipico commented Feb 27, 2024

Description

Our most-upvoted request in the discussion is support for linting of GraphQL files. Unfortunately, GraphQL support is not part of our roadmap for 2024. This means the Biome team will be unlikely to pick up this task as we are busy working on other parts of the roadmap. Still, we would like to facilitate GraphQL support if someone is willing to pick up the work.

What is included in this task

  • A parser for GraphQL
  • At least one lint rule for GraphQL to demonstrate the analyzer
  • Support for *.graphql files in the VS Code extension

What is not included in this task

  • GraphQL tagged templates
    • Support for tagged templates requires infrastructure that is still being worked on in Biome. We are expected to develop support for tagged templates for CSS use cases such as styled components. Once this is in place, and this GraphQL task is implemented, hopefully GraphQL tagged templates will be easy to implement as well.

Funding

We hope someone wants to implement GraphQL support in Biome, so we would like to offer an incentive: We will open a bounty on Polar.sh, which may be claimed by the first contributor to complete the above tasks. 70% of the bounty will be paid out to the contributor, while the remaining 30% will go to Biome itself for reviews, mentoring, and maintenance of the feature (as well as the Polar.sh commission).

If you are interested in working on this task, please respond in the comments or reach out to us on Discord. To be eligible for the bounty, your PR(s) should be merged into Biome, so proper coordination with the team is important. If someone can show relevant progress, we may also close the bounty to others, so they don't have to be afraid of being "outcompeted".

Please be aware that payout of the bounty depends on pledges from our users. If you would like to see this task implemented, please pledge your support on Polar.sh!

Fund with Polar
@ematipico ematipico added S-Help-wanted Status: you're familiar with the code base and want to help the project S-Funding Status: open to funding and implemented by external contributors labels Feb 27, 2024
@polar-sh polar-sh bot added the Fund label Feb 27, 2024
@vasucp1207 vasucp1207 pinned this issue Feb 28, 2024
@vohoanglong0107
Copy link
Contributor

I have raised a PR for implementing GraphQL grammar here #1949

@ematipico
Copy link
Member Author

ematipico commented May 2, 2024

I removed the formatter from the plan to ship GraphQL. Implementing a formatter isn't an easy task.

This could change in the future if we will be able to secure more funding for the people that are working on this task.

@ematipico
Copy link
Member Author

ematipico commented Jun 21, 2024

For anyone subscribed to the issue, we enabled GraphQL support on the playground: https://biomejs.dev/playground/?files.main.gql=dAB5AHAAZQAgAFEAdQBlAHIAeQAgAHsACgAgACAAbQBlADoAIABVAHMAZQByAAoAfQAKACAACgB0AHkAcABlACAAVQBzAGUAcgAgAHsACgAgACAAaQBkADoAIABJAEQACgAgACAAbgBhAG0AZQA6ACAAUwB0AHIAaQBuAGcACgB9AA%3D%3D

Feedback is very welcome!

@eMerzh
Copy link
Contributor

eMerzh commented Jun 22, 2024

Not 100% sure of the feedback needed, but I've tested a few documents and schema I have here and it parses without issues ...
It looks promising 👏

Note prettier panel isn't configured for gql right?

@ematipico
Copy link
Member Author

@eMerzh

No, as for now only parsing is supported.

@ematipico
Copy link
Member Author

Linting is wired: https://biomejs.dev/playground/?lintRules=all&files.main.graphql=cQB1AGUAcgB5ACAAewAKACAAIABtAGUAbQBiAGUAcgAgAEAAZABlAHAAcgBlAGMAYQB0AGUAZAAoAGEAYgBjADoAIAAxADIAMwApAAoAfQA%3D

VSCode support is ready: biomejs/biome-vscode#252

We are still in a bug fixing phase, so we can't merge features just yet in the main branch. Once the bug fixing phase is over we will release a nightly release where you can test the CLi and the LSP

@ematipico
Copy link
Member Author

Closing this issue as completed. You can start testing formatting and linting using this nightly release: https://github.com/biomejs/biome/releases/tag/cli/v1.8.4-nightly.a579bf7

Let's all congrats @vohoanglong0107 for implementing the parsing, @denbezrukov for implementing the formatting and @vohoanglong0107 (again) for staring the works around linting.

@denbezrukov
Copy link
Contributor

@vohoanglong0107 great job!!

Copy link
Member Author

Thank you @vohoanglong0107 for contributing to close this issue! ⭐

The rewards from this issue, totaling $1,050, has been shared with you.

What now?

  1. Create a Polar account
  2. See incoming rewards & setup Stripe to receive them
  3. Get payouts as backers finalize their payments

If you already have a Polar account setup, you don't need to do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fund S-Funding Status: open to funding and implemented by external contributors S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

No branches or pull requests

4 participants