Skip to content

Commit 4e1f73e

Browse files
committed
document syntax highlighting
1 parent f045559 commit 4e1f73e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ var subscription = subscriptionStream.Subscribe(response =>
141141
subscription.Dispose();
142142
```
143143

144+
## Syntax Highlighting for GraphQL strings in IDEs
145+
146+
.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<char>`. IDEs like Visual Studio and Rider can then use this to provide syntax highlighting and checking.
147+
148+
From v6.0.4 on all GraphQL string parameters in this library are decorated with the `[StringSyntax("GraphQL")]` attribute.
149+
150+
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.
151+
152+
For Rider, JetBrains provides a [Plugin](https://plugins.jetbrains.com/plugin/8097-graphql), too.
153+
144154
## Useful Links:
145155

146156
* [StarWars Example Server (GitHub)](https://github.com/graphql/swapi-graphql)

0 commit comments

Comments
 (0)