Skip to content

Instantly share code, notes, and snippets.

@rajatbarman
Last active February 9, 2024 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajatbarman/133b55a83637592801069afdae22d804 to your computer and use it in GitHub Desktop.
Save rajatbarman/133b55a83637592801069afdae22d804 to your computer and use it in GitHub Desktop.
temp_graphql_query.graphql
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