Last active
February 9, 2024 08:23
-
-
Save rajatbarman/133b55a83637592801069afdae22d804 to your computer and use it in GitHub Desktop.
temp_graphql_query.graphql
This file contains hidden or 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
schema | |
@server( | |
port: 8000 | |
graphiql: true | |
hostname: "0.0.0.0" | |
responseHeaders: [ | |
{key: "Content-Security-Policy", value: "frame-ancestors 'self' http://localhost:8080 http://localhost:3000 https://stackblitz.com https://*.webcontainer.io https://tailcall.run https://replit.com https://*.replit.dev;"} | |
{key: "Cross-Origin-Resource-Policy", value: "cross-origin"} | |
{key: "Cross-Origin-Embedder-Policy", value: "credentialless"} | |
] | |
) | |
@upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { | |
query: Query | |
} | |
type Query { | |
posts: [Post] @http(path: "/posts") | |
users: [User] @http(path: "/users") | |
user(id: Int!): User @http(path: "/users/{{args.id}}") | |
} | |
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}}") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment