Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul Hidalgo Caballero committed Jan 27, 2018
1 parent 810141d commit a715293
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public string Render() {
return graphiQLCSHtml;
}
var assembly = typeof(GraphiQLPageModel).GetTypeInfo().Assembly;
var resource = assembly.GetManifestResourceStream("GraphQL.Server.AspNetCore.GraphiQL.Internal.graphiql.cshtml");

var builder = new StringBuilder(new StreamReader(resource).ReadToEnd());
builder.Replace("@Model.GraphQLEndPoint", this.settings.GraphQLEndPoint);
graphiQLCSHtml = builder.ToString();

return this.Render();
using (var manifestResourceStream = assembly.GetManifestResourceStream("GraphQL.Server.AspNetCore.GraphiQL.Internal.graphiql.cshtml"))
using (var streamReader = new StreamReader(manifestResourceStream)) {
var builder = new StringBuilder(streamReader.ReadToEnd());
builder.Replace("@Model.GraphQLEndPoint", this.settings.GraphQLEndPoint);
graphiQLCSHtml = builder.ToString();
return this.Render();
}
}

}
Expand Down

0 comments on commit a715293

Please sign in to comment.