Skip to content

Commit

Permalink
Remove GraphiQL Explorer; fix headers property
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane32 committed Nov 28, 2024
1 parent a530f4b commit b4abb30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions samples/Samples.Basic/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{
GraphQLEndPoint = "/graphql",
SubscriptionsEndPoint = "/graphql",
HeaderEditorEnabled = false,
});

await app.RunAsync();
4 changes: 2 additions & 2 deletions src/Ui.GraphiQL/GraphiQLOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ public class GraphiQLOptions

/// <summary>
/// Enables the header editor when <see langword="true"/>.
/// Not supported when <see cref="ExplorerExtensionEnabled"/> is <see langword="true"/>.
/// </summary>
/// <remarks>
/// Original setting from <see href="https://github.com/graphql/graphiql/blob/08250feb6ee8335c3b1ca83a912911ae92a75722/packages/graphiql/src/components/GraphiQL.tsx#L186">GraphiQL</see>.
/// </remarks>
public bool HeaderEditorEnabled { get; set; } = true;

/// <summary>
/// Enables the explorer extension when <see langword="true"/>.
/// This property has no effect.
/// </summary>
[Obsolete("This property has no effect and will be removed in a future version.")]
public bool ExplorerExtensionEnabled { get; set; } = true;

/// <summary>
Expand Down
13 changes: 1 addition & 12 deletions src/Ui.GraphiQL/Internal/graphiql.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@
integrity="sha384-yz3/sqpuplkA7msMo0FE4ekg0xdwdvZ8JX9MVZREsxipqjU4h8IRfmAMRcb1QpUy"
crossorigin="anonymous"
/>
<script
src="https://unpkg.com/[email protected]/graphiqlWithExtensions.min.js"
integrity="sha384-TqI6gT2PjmSrnEOTvGHLad1U4Vm5VoyzMmcKK0C/PLCWTnwPyXhCJY6NYhC/tp19"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/graphiqlWithExtensions.css"
integrity="sha384-GBqwox+q8UtVEyBLBKloN5QDlBDsQnuoSUfMeJH1ZtDiCrrk103D7Bg/WjIvl4ya"
crossorigin="anonymous"
/>
<script
src="https://unpkg.com/[email protected]/browser/client.js"
integrity="sha384-Eqe2SG8kA+Au+rwrgfWJ+epqYAtKGW/As+WdcywebVKX7377xelWa+/il4CHiHXI"
Expand Down Expand Up @@ -286,7 +275,7 @@
onEditQuery: onEditQuery,
onEditVariables: onEditVariables,
onEditOperationName: onEditOperationName,
headerEditorEnabled: @Model.HeaderEditorEnabled,
isHeadersEditorEnabled: @Model.HeaderEditorEnabled,
}),
document.getElementById('graphiql'),
);
Expand Down

0 comments on commit b4abb30

Please sign in to comment.