Skip to content

Please consider adding [StringSyntax("GraphQL")] attributes #630

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

Closed
lol768 opened this issue Apr 3, 2024 · 4 comments
Closed

Please consider adding [StringSyntax("GraphQL")] attributes #630

lol768 opened this issue Apr 3, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@lol768
Copy link
Contributor

lol768 commented Apr 3, 2024

.NET allows you to use the StringSyntaxAttribute to mark up properties that are being used to hold text that an IDE should consider an "injected language".

E.g. GraphQLRequest.Query could be marked as a GraphQL fragment, and tools such as this VSCode plugin and other IDEs (e.g. JetBrains Rider) would be able to syntax highlight queries automatically.

@lol768 lol768 changed the title Please consider adding [StringSyntax("GraphQL") Please consider adding [StringSyntax("GraphQL")] attributes Apr 3, 2024
lol768 added a commit to lol768/graphql-client that referenced this issue Apr 3, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@rose-a
Copy link
Collaborator

rose-a commented Apr 3, 2024

Hi, good proposal, hadn't noticed the existence of the StringSyntaxAttribute yet.

Requires a multiframework build though, as its only available from .NET 7 onwards and the library is currently built for .NET Standard 2.0...

@rose-a rose-a added the enhancement New feature or request label Apr 3, 2024
@lol768
Copy link
Contributor Author

lol768 commented Apr 3, 2024

That's a good point, my PR doesn't properly deal with that at the moment.

I've got a stub implementation of the attribute to enable it to build for .NET Standard 2.0 (or e.g. net6) but there's probably a bit of additional work to do with the build

@lol768
Copy link
Contributor Author

lol768 commented Apr 3, 2024

Requires a multiframework build though, as its only available from .NET 7 onwards and the library is currently built for .NET Standard 2.0...

Have added multiframework GraphQL.Primitives build to the open PR.

@lol768 lol768 mentioned this issue Apr 3, 2024
rose-a pushed a commit that referenced this issue Apr 16, 2024
* Address #630

* Multi-framework build for primitives project

* PR feedback: extension methods
@rose-a
Copy link
Collaborator

rose-a commented May 21, 2024

added in v6.0.4

@rose-a rose-a closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants