Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8b7c522
Update docs for Heartcore Persisted queries
DeadMonkeyX Oct 14, 2024
76191c6
Update umbraco-heartcore/api-documentation/graphql/README.md
DeadMonkeyX Oct 14, 2024
50635a3
Update umbraco-heartcore/api-documentation/graphql/README.md
DeadMonkeyX Oct 14, 2024
f28a634
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 14, 2024
64cf27d
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 14, 2024
aebc54d
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 14, 2024
d74343e
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 14, 2024
e42c5e0
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 14, 2024
b523c6d
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 14, 2024
ea5db4a
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 14, 2024
7cb1992
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 15, 2024
28094c6
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 15, 2024
ed7a266
Fix: Adds more details on what persisted queries are and links to the…
DeadMonkeyX Oct 16, 2024
3e8f6a0
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 16, 2024
00d5efe
Update umbraco-heartcore/getting-started/graphql-playground.md
DeadMonkeyX Oct 16, 2024
0cd7756
Merge branch 'feat/Heartcore-Persisted-queries' of github.com:DeadMon…
DeadMonkeyX Oct 16, 2024
47fb54c
Update umbraco-heartcore/api-documentation/graphql/persisted-queries.md
DeadMonkeyX Oct 16, 2024
6620f4d
Update umbraco-heartcore/api-documentation/graphql/persisted-queries.md
DeadMonkeyX Oct 17, 2024
c8b188e
Update umbraco-heartcore/api-documentation/graphql/persisted-queries.md
DeadMonkeyX Oct 17, 2024
3501d43
Update umbraco-heartcore/api-documentation/graphql/persisted-queries.md
DeadMonkeyX Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions umbraco-heartcore/api-documentation/graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,39 @@ query {
}
```

## Persisted queries

The GraphQL API supports persisted queries, running a persisted query can be done using the following payload in the graphql request

```json
{
"extensions": {
"persistedQuery": {
"alias": "{Alias}"
}
}
}
```
The persisted queries also supports variables

```json
{
"extensions": {
"persistedQuery": {
"alias": "{Alias}"
}
},
"variables": {
"url": "/"
}
}
```

{% hint style="info" %}
Persisted queries can be created within the backoffice in the [GraphQL Playground](../../getting-started/graphql-playground.md#persisted-queries)
{% endhint %}


## [Schema Generation](schema-generation.md)

Information on how the GraphQL schema is generated, reserved names and built-in custom types.
Expand Down
71 changes: 54 additions & 17 deletions umbraco-heartcore/getting-started/graphql-playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,27 @@
1. Log into the project backoffice
2. Navigate to the Settings dashboard
3. Find the Headless tree near the bottom of the navigation list
4. Click on GraphQL Playground
4. Click on GraphQL

![Where to find GraphQL Playground](images/where-to-find-graphql-playground.png)
![Where to find GraphQL](images/where-to-find-graphql-playground.png)

From there, you can start querying as soon as your content is published.

## Features

### Documentation
### Documentation & Schema

The GraphQL Playground's built-in documentation can be found on the right side, under the "Docs" tab.
The GraphQL Playground's build-in documentation and schema browser can be found on the left toolbar

The documentation tab grants a quick overview of how content is structured using the Document Types in your solution. It also gives an idea of how to access specific properties on each of the Document Types as well as nested properties and properties from Compositions.
This button will open a pane that grants you a quick overview of how content is structured using the Document Types in your solution.

![Documentation Tab in the Playground](images/docs-helper.png)
It also gives an idea of how to access specific properties on each of the Document Types as well as nested properties and properties from Compositions.

Check warning on line 34 in umbraco-heartcore/getting-started/graphql-playground.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words). Raw Output: {"message": "[UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words).", "location": {"path": "umbraco-heartcore/getting-started/graphql-playground.md", "range": {"start": {"line": 34, "column": 1}}}, "severity": "WARNING"}

The documentation will be automatically updated as you add new Document Types to match the schema you have on your project.
While at the same time also explains relationships between specific object and properties in your solution.

## Schema
This will be updated automatically as you make change to the projects schema meaning Document Types, Data Types, Document Type Compositions and Document Type Elements.

The Schema tab also can be found on the right side of the GraphQL Playground. It is located below the "Docs" tab.

The Schema menu explains the relationships between specific objects and properties in your solution, and will be updated automatically as you make changes to the project's schema meaning Document Types, Data Types, Document Type Compositions and Document Type Elements.

![Schema Tab in the Playground](images/schema-helper.png)
![Documentation and schema pane in the Playground](images/schema-helper.png)

## Running GraphQL queries

Expand All @@ -65,26 +61,67 @@

After that, press the "Play" button sitting in the center of the Playground. If the query is constructed correctly, the results will be loaded into the right section.

![Schema Tab in the Playground](images/sample-query.png)
![Sample query in the Playground](images/sample-query.png)

When you are satisfied with the result, you can copy the client URL (CURL) by clicking the `COPY CURL` button located in the top part of the Playground, next to the address bar.

## Sending HTTP headers

GraphQL Playground supports requests made with HTTP headers - in case for example an authorization token is needed. The `HTTP HEADERS` section can be accessed from the bottom-left corner of the Playground window. By default, it contains the `umb-project-alias` header, which is the alias of your Heartcore project. It is possible to add multiple headers.
GraphQL Playground supports requests made with HTTP headers - in case for example an authorization token is needed. The `HTTP HEADERS` section can be accessed from the bottom-right corner of the Playground window. By default, it contains the `umb-project-alias` header, which is the alias of your Heartcore project. It is possible to add multiple headers.

## Query variables

It is also possible to define variables for queries - such variables's values can be changed in the bottom-left corner of the Playground window, next to the `HTTP HEADERS` section.

![Schema Tab in the Playground](images/query-variables.png)
![Sample query with variables in the Playground ](images/query-variables.png)

## History

If you happened to make an amazing query and afterwards erased it by accident, you would be able to re-use it by finding it in the History. The History menu can be found in the top part of the Playground, above the query input section.
If you happened to make an amazing query and afterwards erased it by accident, you would be able to re-use it by finding it in the History.

Check warning on line 80 in umbraco-heartcore/getting-started/graphql-playground.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words). Raw Output: {"message": "[UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words).", "location": {"path": "umbraco-heartcore/getting-started/graphql-playground.md", "range": {"start": {"line": 80, "column": 1}}}, "severity": "WARNING"}

The History pane can be opened by clicking the history button in the toolbar to the left.

![Shows where the history button is](images/query-history.png)

## Prettify

The Playground gives you an option to "prettify" your query with a click of a button, which makes it easier for humans to read.

![Schema Tab in the Playground](images/prettify.png)

## Persisted Queries

The Graphql playground supports persisted graphql queries.
To access Persisted queries you have to go to the [GraphQL Playground](#accessing-graphql-playground) and click the persisted queries tab

![Persisted queries tab](images/persisted-queries-tab.png)

### Create a new persisted query

1. Click the `Create Persisted Query` button
2. Enter a name for the query in the new query editor that appears
3. Write your query in the editor
4. Click the `Save` button

![Create persisted query](images/create-persisted-query.png)

### Update a persisted query

1. Find the query you want to update in the persisted queries list
2. Click on the name of the query
3. An editor will appear with the query
4. Make your changes and click the `Save` button

![Update persisted query](images/update-persisted-query.png)

### Delete a persisted query

1. Find the query you want to delete in the persisted queries list
2. Click on the name of the query
3. An editor will appear with the query
4. Click the action menu in the top right corner of the editor
5. Click the `Delete` button
6. Confirm the deletion

![Delete persisted query](images/delete-persisted-query.png)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified umbraco-heartcore/getting-started/images/prettify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified umbraco-heartcore/getting-started/images/query-variables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified umbraco-heartcore/getting-started/images/sample-query.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified umbraco-heartcore/getting-started/images/schema-helper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading