Comments (1)
@andimarek Hello! Thank you for considering this issue. The main difficulty with using the graphql-java library as is, lies in its design for very different use cases. From the IDE perspective, we need a library that can build a schema quickly and frequently. It should offer ways to extend types, fine-tune the schema-building and validation process, and crucially, handle schemas that are broken 90 percent of the time during editing in the editor.
The situation is further complicated because we use graphql-java not only for validation, but also for reference resolution, and completion. If a schema is not completely accurate, it can create various issues. For instance, all queries and types in the IDE might be marked as read, and there might be no autocompletion.
I have a list of the changes I've made over the past years. However, not all of these modifications have been implemented, or I may forget to mention some of them here:
- We need the ability to extend both types and nodes. Consider the constructor of
AbstractNode
. SinceadditionalData
is a String map, it can't store IDE's data. Therefore, I've extended the constructor to accept a PSI node and a collection of other source nodes. This is useful when a node is built from multiple nodes with the same name. Additionally, I've overridden the method to calculate source location based on this information. - You deprecated type constructors some time ago. I've seen an issue where you were resistant to changing that, but it's also necessary to extend types.
- Defensive copying creates substantial pressure on the GC when editing a schema file and continuously building new schemas in the background.
- We need to configure the schema print output format flexibly, as our GraphQL formatter is not yet implemented.
- Likely, we need the ability to construct a schema and replace type references lazily.
- Instead of throwing errors and making assertions, we need to store the error and continue with schema building and validation. Many assertions, see a commit 08d08c4, have been removed to achieve this. For example, 08d08c4#diff-2f22382be9e83bd8a1812df273f85a43588a78d79d49cfc859853889aff9ffd2R43, 08d08c4#diff-6c2708a17808e6d4e8f811dfa0be99a25fd3d4dec518e4241cd3a30e2d6cdd96R20, 08d08c4#diff-2243acc5cc1120d48dbd9896dbb03a4644b562edfef35ba426d50f94fd546662R120, and many more.
- We need the ability to customize error messages. For example, see 41fc0b8.
- Tolerate schema errors, such as:
- Missing types.
- Duplicate types with the same names (provide a merge strategy for them, but retain the original types with all related information).
- Incomplete syntax. For example,
type Query { id: ID name: <caret> }
should be a valid type in the schema with anid
field and aname
field without a type (and this also will cause an assertion in the current implementation of graphql-java).
- The schema building process should be cancellable. In IntelliJ IDEA, this is achieved using
ProgressIndicator
, for instance, through a call likeProgressManager.checkCanceled()
. This function should be called frequently to cancel an ongoing schema building operation if the user changes a syntax tree concurrently and the schema is requested again.
I'm eager to participate in this activity and contribute. However, I'm not sure if this aligns with your priorities and vision for the future of graphql-java. If not, my plan is to completely rewrite both the resolve and completion from scratch, using graphql-java solely for query validation, and finally remove it from the repository to be able to update it regularily.
from js-graphql-intellij-plugin.
Related Issues (20)
- Plugin crashes PyCharm every day
- Failed to evaluate config in TS-based project with ESM imports HOT 3
- Unable to change runtime variable after first time HOT 8
- @octokit/graphql-schema not working HOT 3
- Persist manually provided environment variables between IDE restarts
- Feature Request: add support custom http request headers for individual requests, similar to Apollo Playground HOT 1
- PhpStorm gatsby autodiscover error HOT 2
- A way for plugins to manage library definitions HOT 2
- Glob pattern not working for schema config
- GraphQL intropection: The server introspection response cannot be parsed as a valid JSON object. HOT 2
- Unexpected "Unknown directive location" errors when viewing schema
- Please provide injection for c-style comments without assigning to a variable
- Unknown field "__typename" when viewing graphql documents
- Plugin does not recurse into Magento subdirectories when assembling schema files HOT 3
- Register a schema from a third-party plugin that is only used when specific conditions are met
- [Feature request] Transform subscriptions into queries when executing from plugin
- GraphQL Query result is not formatted HOT 2
- Cannot interact with GraphQL toolbar HOT 2
- Error highlighting does not work for me HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-graphql-intellij-plugin.