From 4e1f73ea2ac330f408e0c912cbb99e6e57d9eabc Mon Sep 17 00:00:00 2001 From: Alexander Rose Date: Mon, 22 Apr 2024 11:10:56 +0200 Subject: [PATCH] document syntax highlighting --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0866ef7a..0d2053c8 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,16 @@ var subscription = subscriptionStream.Subscribe(response => subscription.Dispose(); ``` +## Syntax Highlighting for GraphQL strings in IDEs + +.NET 7.0 introduced the [StringSyntaxAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.stringsyntaxattribute?view=net-8.0) to have a unified way of telling what data is expected in a given `string` or `ReadOnlySpan`. IDEs like Visual Studio and Rider can then use this to provide syntax highlighting and checking. + +From v6.0.4 on all GraphQL string parameters in this library are decorated with the `[StringSyntax("GraphQL")]` attribute. + +Currently, there is no native support for GraphQL formatting and syntax highlighting in Visual Studio, but the [GraphQLTools Extension](https://marketplace.visualstudio.com/items?itemName=codearchitects-research.GraphQLTools) provides that for you. + +For Rider, JetBrains provides a [Plugin](https://plugins.jetbrains.com/plugin/8097-graphql), too. + ## Useful Links: * [StarWars Example Server (GitHub)](https://github.com/graphql/swapi-graphql)