-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
GraphQL Schema #6639
GraphQL Schema #6639
Conversation
|
||
await context.Response.WriteAsync(printer.Print()); | ||
|
||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you dont need the return here?
|
||
using (var printer = new SchemaPrinter(schema)) | ||
{ | ||
context.Response.ContentType = "application/text"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this be application/json?
{ | ||
private readonly RequestDelegate _next; | ||
|
||
public SchemaMiddleware(RequestDelegate next) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could probably ditch this ctor as its not used
|
||
public async Task Invoke(HttpContext context, ISchemaFactory schemaService) | ||
{ | ||
var schema = await schemaService.GetSchemaAsync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably check permissions .. dont wanna leak the schema just because graphql is turned on ...
|
||
await context.Response.WriteAsync(printer.Print()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think you still need to invoke _next ?
Closing. It was just a test to see if we could export the GraphQL schema. |
Export GraphQL Schema to text file.
Call
https://localhost:44300/api/schema.graphql