Skip to content

Commit

Permalink
update cors.graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Apr 22, 2024
1 parent 738ac12 commit f792e85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions examples/cors.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,19 @@ schema
port: 8000
graphiql: true
hostname: "0.0.0.0"
headers: {cors: {allowOrigins: ["abc.xyz"], allowHeaders: ["Authorization"], allowMethods: [POST, GET, OPTIONS]}}
headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}}
)
@upstream(baseURL: "http://jsonplaceholder.typicode.com") {
query: Query
}

type Query @cache(maxAge: 30000) {
type Query {
posts: [Post] @http(path: "/posts")
}

type User {
id: Int!
name: String!
username: String!
email: String!
phone: String
website: String
}

type Post {
id: Int!
userId: Int!
title: String!
body: String!
user: User @http(path: "/users/{{value.userId}}")
}
2 changes: 1 addition & 1 deletion examples/jsonplaceholder.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
schema
@server(port: 8000, graphiql: true, hostname: "0.0.0.0")
@server(port: 8000, headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}})
@upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true, batch: {delay: 100}) {
query: Query
}
Expand Down

0 comments on commit f792e85

Please sign in to comment.