Skip to content

Setting a relative URI as EndPoint causes an exception #309

Open
@rose-a

Description

@rose-a

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions