You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-39Lines changed: 37 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,15 @@ Please note this **should not be used in production**, since there are **no secu
10
10
11
11
## How does it work
12
12
13
-
An Owin middleware exposes Umbraco Published Content as a GraphQL endpoint.
14
-
15
-
GraphQL types are dynamically generated for all Umbraco document types (content and media), with all the properties as fields. They all implement an interface `PublishedContent` which implements the generic Umbraco properties as fields.
13
+
GraphQL types are dynamically generated for all Umbraco document types (content and media), with all the properties as fields.
16
14
17
15
## Installation
18
16
19
17
The preferred way to install GraphQL for Umbraco is through NuGet
20
18
21
19
### Option 1: NuGet
22
20
23
-
GraphQL for Umbraco is available as a NuGet [package](https://www.nuget.org/packages/Our.Umbraco.GraphQL).
21
+
GraphQL for Umbraco is available as a [NuGet package](https://www.nuget.org/packages/Our.Umbraco.GraphQL).
24
22
25
23
To install run the following command in the [Package Manager Console](https://docs.nuget.org/docs/start-here/using-the-package-manager-console)
Clone the repository and run the Website (F5 in Visual Studio), install Umbraco with the starter kit and start exploring the API using the GraphQL Playground by opening `/umbraco/graphql`.
When installing the [NuGet package](https://www.nuget.org/packages/Our.Umbraco.GraphQL) a new file `App_Start/GraphQLComponent.cs` is added to the project, it contains the bootstrapping code for adding GraphQL to the project and the default configuration
The Umbraco queries/types can be found under the `umbraco` field.
41
+
42
+
```graphql
43
+
{
44
+
umbraco {
45
+
content {
46
+
atRoot {
47
+
all {
48
+
}
49
+
# ... document types are added as fields
50
+
}
51
+
byId(id: "id") {
52
+
}
53
+
byType {
54
+
# ... document types are added as fields
55
+
}
56
+
byUrl(url: "url") {
57
+
}
58
+
}
59
+
}
60
+
}
61
+
```
62
+
63
+
## Metrics
64
+
65
+
[Apollo Tracing](https://github.com/apollographql/apollo-tracing) is enabled by default and is displayed in the GraphQL Playground, it collects the execution time for each field.
66
+
67
+
If you need more insight, [Miniprofiler](https://miniprofiler.com/dotnet/) can be enabled by setting the option `EnableMiniprofiler=true`, MiniProfiler is implemented throughout the Umbraco code base and collects a lot of metrics. The data will be accessiblo in the `extensions.miniProfiler` field in the response.
0 commit comments