silverstripe-webpack/app/_config/base-graphql.yml

59 lines
1.6 KiB
YAML

---
Name: webapp-base-graphql
After: graphqlconfig
---
SilverStripe\Control\Director:
rules:
'graphql': '%$SilverStripe\GraphQL\Controller.default'
SilverStripe\GraphQL\Controller:
cors:
Enabled: true
Allow-Origin:
- '127.0.0.1:3001'
- 'localhost:3001'
- 'http://127.0.0.1'
- 'http://127.0.0.1:3001'
- 'http://127.0.0.1:3000'
- 'https://127.0.0.1'
- 'https://127.0.0.1:3001'
- 'https://127.0.0.1:3000'
- 'http://localhost'
- 'http://localhost:3001'
- 'http://localhost:3000'
- 'https://localhost'
- 'https://localhost:3001'
- 'https://localhost:3000'
- 'twma.pro'
- 'tony.twma.pro'
- 'http://twma.pro'
- 'https://twma.pro'
- 'http://tony.twma.pro'
- 'https://tony.twma.pro'
Allow-Headers: 'Authorization, Content-Type, Content-Language, apikey'
Allow-Methods: 'GET, PUT, DELETE, OPTIONS, POST'
#Allow-Credentials: 'true'
Max-Age: 600 # 600 seconds = 10 minutes.
SilverStripe\GraphQL\Auth\Handler:
authenticators:
- class: Site\GraphQL\APIKeyAuthenticator
priority: 30
SilverStripe\GraphQL\Manager.default:
properties:
Middlewares:
APIKeyMiddleware: Site\GraphQL\APIKeyMiddleware
SilverStripe\GraphQL\Manager:
schemas:
default:
types:
member: 'Site\GraphQL\MemberTypeCreator'
page: 'Site\GraphQL\PageTypeCreator'
element: 'Site\GraphQL\ElementTypeCreator'
queries:
readPages: 'Site\GraphQL\PaginatedReadPagesQueryCreator'
readMembers: 'Site\GraphQL\ReadMembersQueryCreator'
paginatedReadMembers: 'Site\GraphQL\PaginatedReadMembersQueryCreator'