Skip to content

Commit

Permalink
testing mutliple configs
Browse files Browse the repository at this point in the history
  • Loading branch information
shashitnak committed Jun 5, 2024
1 parent e7f4df6 commit fe948c8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
14 changes: 4 additions & 10 deletions config.graphql
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
schema
@upstream(baseURL: "http://jsonplaceholder.typicode.com") {
@upstream(baseURL: "http://jsonplaceholder.typicode.com")
@link(type: Config, src: "./user/user.graphql")
@link(type: Config, src: "./post.graphql")
{
query: Query
}

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}}")
}
15 changes: 15 additions & 0 deletions post.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schema @upstream(baseURL: "http://jsonplaceholder.typicode.com") {
query: Query
}

type Query {
post(id: Int!): Post @http(path: "/posts/{{.args.id}}")
}

type Post {
id: Int!
userId: Int!
title: String!
body: String!
user: User @http(path: "/users/{{.value.userId}}")
}
16 changes: 16 additions & 0 deletions user/user.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
schema @upstream(baseURL: "http://jsonplaceholder.typicode.com") {
query: Query
}

type Query {
user(id: Int!): User @http(path: "/users/{{.args.id}}")
}

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

0 comments on commit fe948c8

Please sign in to comment.