Skip to content

Commit

Permalink
Merge pull request #25 from Linq2GraphQL/docs-update
Browse files Browse the repository at this point in the history
docs more docs
  • Loading branch information
joadan committed Oct 29, 2023
2 parents f6516f0 + d799a7a commit e300724
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
6 changes: 2 additions & 4 deletions docs/Linq2GraphQL.Docs/Components/Samples/SamplesViewer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
</div>


<div style="max-height:200px">
@((MarkupString)queryHtml)
</div>
@((MarkupString)queryHtml)

@if (isExpanded)
{
<Tabs @ref=tabs>

<Tab Title="Query">
<div style="height:300px">
<StandaloneCodeEditor Id="@(id + "_query")" ConstructionOptions="QueryConstructionOptions" />
Expand Down
18 changes: 5 additions & 13 deletions docs/Linq2GraphQL.Docs/Components/Samples/SamplesViewer.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ namespace Linq2GraphQL.Docs.Components.Samples
public partial class SamplesViewer<T, TResult>
{
private GraphQLRequest request;
private string requestJson;


[Inject] private HttpClient httpClient { get; set; }
[Inject] private TablerService tablerService { get; set; }

Expand All @@ -34,12 +33,8 @@ protected override async Task OnInitializedAsync()
{
jsonOptions.WriteIndented = true;
await LoadCodeAsync();

request = await QueryExecute.GetRequestAsync();
requestJson = JsonSerializer.Serialize(request, jsonOptions);




await base.OnInitializedAsync();
}

Expand All @@ -59,6 +54,7 @@ private async Task LoadCodeAsync()
catch (Exception ex)
{
queryHtml = FormatHtml($"Unable to get code: Error {ex.Message}");

}
}

Expand All @@ -67,7 +63,7 @@ private string FormatHtml(string source)
{
if (string.IsNullOrWhiteSpace(source))
{
source = "No Code....";
source = @"No code..";
}

var formatter = new HtmlClassFormatter();
Expand Down Expand Up @@ -99,14 +95,10 @@ private async Task ExecuteAsync()
{
isExecuting = true;
await QueryExecute.ExecuteAsync();




}
catch (Exception ex)

Check warning on line 99 in docs/Linq2GraphQL.Docs/Components/Samples/SamplesViewer.razor.cs

View workflow job for this annotation

GitHub Actions / deploy

The variable 'ex' is declared but never used

Check warning on line 99 in docs/Linq2GraphQL.Docs/Components/Samples/SamplesViewer.razor.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'ex' is declared but never used

Check warning on line 99 in docs/Linq2GraphQL.Docs/Components/Samples/SamplesViewer.razor.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'ex' is declared but never used
{

//TODO add error modal
throw;
}
finally
Expand Down
6 changes: 6 additions & 0 deletions docs/Linq2GraphQL.Docs/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
color: #ff8383;
}

.csharp {
max-height: 300px;
overflow: auto;
margin-bottom: 0.5rem !important;
padding:5px
}

/*Monaco Editor*/
.monaco-editor-container { /* for all editor instances */
Expand Down

0 comments on commit e300724

Please sign in to comment.