@@ -98,12 +98,12 @@ <h2 id="custom-configuration" style="position:relative;"><a href="#custom-config
9898< h3 id ="changing-the-graphiql-path " style ="position:relative; "> < a href ="#changing-the-graphiql-path " aria-label ="changing the graphiql path permalink " class ="anchor before "> < svg aria-hidden ="true " focusable ="false " height ="16 " version ="1.1 " viewBox ="0 0 16 16 " width ="16 "> < path fill-rule ="evenodd " d ="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z "> </ path > </ svg > </ a > Changing the GraphiQL path</ h3 >
9999< p > To change the default path from < code class ="language-text "> /ui/graphiql</ code > , pass a custom path to the < code class ="language-text "> UseGraphQLGraphiQL()</ code > method.</ p >
100100< p > Example:</ p >
101- < div class ="gatsby-highlight " data-language ="csharp "> < pre class ="language-csharp "> < code class ="language-csharp "> app< span class ="token punctuation "> .</ span > < span class ="token function "> UseGraphQLGraphiQL</ span > < span class ="token punctuation "> (</ span > < span class ="token string "> "/my/own/path/to/graphiql"</ span > < span class ="token punctuation "> )</ span > < span class ="token punctuation "> ;</ span > ` </ code > </ pre > </ div >
101+ < div class ="gatsby-highlight " data-language ="csharp "> < pre class ="language-csharp "> < code class ="language-csharp "> app< span class ="token punctuation "> .</ span > < span class ="token function "> UseGraphQLGraphiQL</ span > < span class ="token punctuation "> (</ span > < span class ="token string "> "/my/own/path/to/graphiql"</ span > < span class ="token punctuation "> )</ span > < span class ="token punctuation "> ;</ span > </ code > </ pre > </ div >
102102< h3 id ="changing-the-graphql-endpoint " style ="position:relative; "> < a href ="#changing-the-graphql-endpoint " aria-label ="changing the graphql endpoint permalink " class ="anchor before "> < svg aria-hidden ="true " focusable ="false " height ="16 " version ="1.1 " viewBox ="0 0 16 16 " width ="16 "> < path fill-rule ="evenodd " d ="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z "> </ path > </ svg > </ a > Changing the GraphQL endpoint</ h3 >
103103< p > To change the default GraphQL endpoint from < code class ="language-text "> /graphql</ code > , set a custom endpoint using the < code class ="language-text "> GraphiQLOptions.GraphQLEndPoint</ code > property</ p >
104104< p > Example:</ p >
105105< div class ="gatsby-highlight " data-language ="csharp "> < pre class ="language-csharp "> < code class ="language-csharp "> < span class ="token class-name "> < span class ="token keyword "> var</ span > </ span > graphiQLOptions < span class ="token operator "> =</ span > < span class ="token keyword "> new</ span > < span class ="token constructor-invocation class-name "> GraphiQLOptions</ span > < span class ="token punctuation "> {</ span > GraphQLEndPoint < span class ="token operator "> =</ span > < span class ="token string "> "/my/own/graphql/endpoint"</ span > < span class ="token punctuation "> }</ span >
106- app< span class ="token punctuation "> .</ span > < span class ="token function "> UseGraphQLGraphiQL</ span > < span class ="token punctuation "> (</ span > < span class ="token named-parameter punctuation "> options</ span > < span class ="token punctuation "> :</ span > graphiQLOptions< span class ="token punctuation "> )</ span > < span class ="token punctuation "> ;</ span > ` </ code > </ pre > </ div >
106+ app< span class ="token punctuation "> .</ span > < span class ="token function "> UseGraphQLGraphiQL</ span > < span class ="token punctuation "> (</ span > < span class ="token named-parameter punctuation "> options</ span > < span class ="token punctuation "> :</ span > graphiQLOptions< span class ="token punctuation "> )</ span > < span class ="token punctuation "> ;</ span > </ code > </ pre > </ div >
107107< h3 id ="adding-http-headers " style ="position:relative; "> < a href ="#adding-http-headers " aria-label ="adding http headers permalink " class ="anchor before "> < svg aria-hidden ="true " focusable ="false " height ="16 " version ="1.1 " viewBox ="0 0 16 16 " width ="16 "> < path fill-rule ="evenodd " d ="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z "> </ path > </ svg > </ a > Adding HTTP headers</ h3 >
108108< p > You can initialize GraphiQL with custom HTTP headers, such as providing a default JWT token for authentication, by setting the < code class ="language-text "> GraphiQLOptions.Headers</ code > property.</ p >
109109< p > Example:</ p >
@@ -115,7 +115,7 @@ <h3 id="adding-http-headers" style="position:relative;"><a href="#adding-http-he
115115 < span class ="token punctuation "> }</ span >
116116< span class ="token punctuation "> }</ span > < span class ="token punctuation "> ;</ span >
117117
118- app< span class ="token punctuation "> .</ span > < span class ="token function "> UseGraphQLGraphiQL</ span > < span class ="token punctuation "> (</ span > < span class ="token named-parameter punctuation "> options</ span > < span class ="token punctuation "> :</ span > graphiQLOptions< span class ="token punctuation "> )</ span > < span class ="token punctuation "> ;</ span > ` </ code > </ pre > </ div >
118+ app< span class ="token punctuation "> .</ span > < span class ="token function "> UseGraphQLGraphiQL</ span > < span class ="token punctuation "> (</ span > < span class ="token named-parameter punctuation "> options</ span > < span class ="token punctuation "> :</ span > graphiQLOptions< span class ="token punctuation "> )</ span > < span class ="token punctuation "> ;</ span > </ code > </ pre > </ div >
119119< h2 id ="additional-resources " style ="position:relative; "> < a href ="#additional-resources " aria-label ="additional resources permalink " class ="anchor before "> < svg aria-hidden ="true " focusable ="false " height ="16 " version ="1.1 " viewBox ="0 0 16 16 " width ="16 "> < path fill-rule ="evenodd " d ="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z "> </ path > </ svg > </ a > Additional Resources</ h2 >
120120< p > You may find GraphiQL example in < a href ="https://github.com/graphql-dotnet/graphql-dotnet/blob/master/src/GraphQL.Harness/Startup.cs "> graphql-dotnet</ a > repo.
121121< a href ="https://github.com/graphql-dotnet/examples/tree/master/src/AspNetCoreCustom "> This ASP.NET Core sample project</ a > also provides an example of hosting
0 commit comments