Skip to content

Commit 30d3e31

Browse files
committed
add note on usage of GraphQLHttpClient
1 parent 4e1f73e commit 30d3e31

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ The Library will try to follow the following standards and documents:
2929
var graphQLClient = new GraphQLHttpClient("https://api.example.com/graphql", new NewtonsoftJsonSerializer());
3030
```
3131

32+
> [!NOTE]
33+
> *GraphQLHttpClient* is meant to be used as a single longlived instance per endpoint (i.e. register as singleton in a DI system) to be reused for multiple requests.
34+
3235
### Create a GraphQLRequest:
3336
#### Simple Request:
3437
```csharp
@@ -64,7 +67,8 @@ var personAndFilmsRequest = new GraphQLRequest {
6467
};
6568
```
6669

67-
Be careful when using `byte[]` in your variables object, as most JSON serializers will treat that as binary data! If you really need to send a *list of bytes* with a `byte[]` as a source, then convert it to a `List<byte>` first, which will tell the serializer to output a list of numbers instead of a base64-encoded string.
70+
> [!WARNING]
71+
> Be careful when using `byte[]` in your variables object, as most JSON serializers will treat that as binary data! If you really need to send a *list of bytes* with a `byte[]` as a source, then convert it to a `List<byte>` first, which will tell the serializer to output a list of numbers instead of a base64-encoded string.
6872
6973
### Execute Query/Mutation:
7074

0 commit comments

Comments
 (0)