Skip to content

Commit f792e85

Browse files
committed
update cors.graphql
1 parent 738ac12 commit f792e85

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

examples/cors.graphql

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,19 @@ schema
33
port: 8000
44
graphiql: true
55
hostname: "0.0.0.0"
6-
headers: {cors: {allowOrigins: ["abc.xyz"], allowHeaders: ["Authorization"], allowMethods: [POST, GET, OPTIONS]}}
6+
headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}}
77
)
88
@upstream(baseURL: "http://jsonplaceholder.typicode.com") {
99
query: Query
1010
}
1111

12-
type Query @cache(maxAge: 30000) {
12+
type Query {
1313
posts: [Post] @http(path: "/posts")
1414
}
1515

16-
type User {
17-
id: Int!
18-
name: String!
19-
username: String!
20-
email: String!
21-
phone: String
22-
website: String
23-
}
24-
2516
type Post {
2617
id: Int!
2718
userId: Int!
2819
title: String!
2920
body: String!
30-
user: User @http(path: "/users/{{value.userId}}")
3121
}

examples/jsonplaceholder.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
schema
2-
@server(port: 8000, graphiql: true, hostname: "0.0.0.0")
2+
@server(port: 8000, headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}})
33
@upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true, batch: {delay: 100}) {
44
query: Query
55
}

0 commit comments

Comments
 (0)