-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CONTRIBUTING, CHANGELOG and minimal documentation
- Loading branch information
Showing
4 changed files
with
145 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Change log | ||
|
||
All notable changes to this project will be documented in this file. | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## 0.1.0 - 2018-10-12 | ||
|
||
- First release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Contributing | ||
|
||
## Bug Reports & Feature Requests | ||
|
||
Please use the [issue tracker](https://github.com/rasmusjp/umbraco-graphql/issues) to report any bugs or file feature requests. | ||
|
||
## Developing | ||
|
||
### Prerequisites | ||
|
||
- Visual Studio | ||
- IIS Express | ||
|
||
### Setup | ||
|
||
First build the Solution | ||
|
||
Run the `samples/Website` project, this will start IIS Express listeninng on `http://localhost:49937` | ||
|
||
Install Umbraco with the starter kit, so you have some sample data. | ||
|
||
### Folder structure | ||
|
||
``` | ||
. | ||
├── samples # Sample projects | ||
│ └── Website # Sample/development site | ||
├── src # Source Files | ||
│ └── Our.Umbraco.GraphQL # Main Project | ||
├── test # Tests Projects | ||
│ └── Our.Umbraco.GraphQL.Tests # Unit Tests | ||
└── tools # Build tools | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Documentation | ||
|
||
## Configuration | ||
|
||
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 | ||
|
||
```csharp | ||
var path = $"/{_globalSettings.GetUmbracoMvcArea()}/graphql"; | ||
|
||
app.UseUmbracoGraphQL(path, _factory, opts => | ||
{ | ||
opts.Debug = HostingEnvironment.IsDevelopmentEnvironment; | ||
opts.EnableMetrics = true; | ||
opts.EnableMiniProfiler = false; | ||
opts.EnablePlayground = true; | ||
}); | ||
``` | ||
|
||
The configuration options are: | ||
|
||
| Option | Description | | ||
| -------------------------------- | -------------------------------------------------------------------------------------------------------- | | ||
| CorsPolicyProvider | The Cors Policy Provider | | ||
| Debug | Should exceptions be exposed in the response | | ||
| EnableMetrics | Should metrics be enabled | | ||
| EnableMiniProfiler | Should MiniProfiler be enabled | | ||
| EnablePlayground | Should the GraphQL Playground be enabled | | ||
| PlaygroundSettings | Custom settings for the [GraphQL Playground](https://github.com/prisma-labs/graphql-playground#settings) | | ||
| SetCorsPolicy(CorsPolicy policy) | Sets the Cors Policy | | ||
|
||
## Default Urls | ||
|
||
| Method | Url | Description | | ||
| ------ | ---------------- | ------------------ | | ||
| GET | /umbraco/graphql | GraphQL Playground | | ||
| POST | /umbraco/graphql | GraphQL endpoint | | ||
|
||
## Querying | ||
|
||
The Umbraco queries/types can be found under the `umbraco` field. | ||
|
||
```graphql | ||
{ | ||
umbraco { | ||
content { | ||
atRoot { | ||
all { | ||
} | ||
# ... document types are added as fields | ||
} | ||
byId(id: "id") { | ||
} | ||
byType { | ||
# ... document types are added as fields | ||
} | ||
byUrl(url: "url") { | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Metrics | ||
|
||
[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. | ||
|
||
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. |