Support for schema IDL language
See original GitHub issueLanguage service features for schema IDL language would be amazing to have - there has already been some work done to begin the effort. After talking with some folks and researching on some ongoing efforts, I think I’m ready to propose a plan:
- Changes to
graphql-js
- Modify the code to throw validation errors to include a source location
- Write a schema validator
// For example,
// in graphql-js/src/validation/rules/SchemaValidator.js
export function SchemaValidator(context: ValidationContext): any {
return {
// This will consist of all sanity/invariant checks in buildASTSchema/extendSchema
// For example,
TypeExtensionDefinition(node) {
if (!context.getSchema().getType(node.definition.type.value) {
context.reportError(new GraphQLError(
`Cannot extend type "${extendedTypeName}" because it does not ` +
'exist in the existing schema.',
[ def.definition ],
));
}
},
};
}
- Diagnostics
- Add another step to extract/validate using buildASTSchema/schema validator
- Autocompletion
- Add support for IDL language
- GraphQL language server
-
MessageProcessor
should be able to grab the edited content, run the above schema validator, and extend the schema -
MessageProcessor
should also be able to remove type definitions from the schema on the fly -
MessageProcessor
, when the file is saved, should be able to rebuild the schema
cc @RomanGotsiy
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:12 (12 by maintainers)
Top Results From Across the Web
IDL Language - Apache Avro
The aim of the Avro IDL language is to enable developers to author schemata in a ... Apache Avro IDL Schema Support 203.1.2...
Read more >Supported Inter-Language Communication Techniques
IDL supports a number of different techniques for communicating with the operating system and programs written in other languages.
Read more >Apache Avro IDL Schema Support - IntelliJ IDEs Plugin
Avro IDL Schema Support extends Intellij IDEs to more easily work with Avro schemata and protocols in IDL or JSON format. IDL (...
Read more >Writing a schema - FlatBuffers - Google
The syntax of the schema language (aka IDL, Interface Definition Language) should look quite familiar to users of any of the C family...
Read more >Language Guide (proto3) | Protocol Buffers - Google Developers
In languages that support open enum types with values outside the range of specified symbols, such as C++ and Go, the unknown enum...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
we already use vscode-languageserver in our server implementation, not sure how extensively, and also vscode-jsonrpc of course, but there are a number of other official language service packages we could be using across service, interface etc to make things easier potentially. vscode-typescript-service is a good point of reference, json-service as well as it relies on an remote schema like ours. apollo’s language services are built on top of ours and aim to be more like the former. I still have a lot to learn in this arena, mostly am just focused on the graphiql monaco POC at the moment. Overall I think there are opportunities to leverage the vscode lsp packages more extensively to keep from having to maintain a lot of redundant code. If you have access to the GraohiQL Maintainers team, the first discussion post that Lee made has some comments from @martijnwalraven about these topics
Hey, I have to apologise. I must have been looking at an outdated version. I’m glad we already tackled using the VSCode package. Yeah, then let’s move forward with this 😃