graphql-dotnet / graphql-dotnet/graphql-client

Setting a relative URI as EndPoint causes an exception

Open
#309 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
648
Forks
136
PR merge metrics
No merged PRs in 30d

Description

Reported by @stuartdga as comment on commit 94a1e32

> I believe that you introduced a breaking change. Before this version we could use the following:
>
> var settings = new GraphQLHttpClientOptions
> {
> EndPoint = new Uri("/graphql", UriKind.Relative)
> };
>
> var client = new GraphQLHttpClient(settings, new SystemTextJsonSerializer(), httpClient);
>
> Now we get an exception when initializing the client that a relative URI is not valid.

> We initialize an HttpClient in our Web API's that has its BaseAddress set. These API's are configured to use the following URL in startup:
>
> app.UseGraphQL("/graphql");
>
> Then when we want to send a request we were using the code in my comment above to initialize the GraphQL client. Using the relative URL was working prior to this change. Now we get an error. We can update our code to use only absolute URL's but that will be a number of changes to deployed code. So this was a "breaking change".

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.