diff --git a/examples/cors.graphql b/examples/cors.graphql index 7dfc04dd04..3d4c4af23a 100644 --- a/examples/cors.graphql +++ b/examples/cors.graphql @@ -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}}") } diff --git a/examples/jsonplaceholder.graphql b/examples/jsonplaceholder.graphql index 622f9af1ae..5a0ede4396 100644 --- a/examples/jsonplaceholder.graphql +++ b/examples/jsonplaceholder.graphql @@ -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 }