Skip to content
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

Closed
wants to merge 4 commits into from
Closed

GraphQL Schema #6639

wants to merge 4 commits into from

Conversation

agriffard
Copy link
Member

Export GraphQL Schema to text file.

Call https://localhost:44300/api/schema.graphql


await context.Response.WriteAsync(printer.Print());

return;
Copy link
Member

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";
Copy link
Member

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)
Copy link
Member

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();
Copy link
Member

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());
}
}
Copy link
Member

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 ?

@agriffard
Copy link
Member Author

Closing. It was just a test to see if we could export the GraphQL schema.

@agriffard agriffard closed this Dec 7, 2020
@agriffard agriffard deleted the ag/graphqlSchema branch October 5, 2021 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants