subgraphs:
connectors:
routing_url: none
schema:
sdl: |
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.10")
@link(
url: "https://specs.apollo.dev/connect/v0.1"
import: ["@connect", "@source"]
)
@source(
name: "json"
http: {
baseURL: "https://jsonplaceholder.typicode.com/"
}
)
type User {
id: ID!
name: String
occupation: String
address: Address
pet: Pet
}
type Address {
street: String
zip: String
}
type Pet {
name: String
species: String
}
type Query {
user(id: ID!): User
@connect(
source: "json"
http: { GET: "/users/{$$args.id}" }
selection: """
id
name
occupation: job
address {
street
zip
}
pet {
name
species
}
"""
entity: true
)
defaultArgs(
str: String = "default"
int: Int = 42
float: Float = 1.23
bool: Boolean = true
# TODO: input enums will be supported after 2.10.0-alpha.2
arr: [String] = ["default"]
): String
@connect(
source: "json"
http: { POST: "/default-args", body: "str: $$args.str int: $$args.int float: $$args.float bool: $$args.bool arr: $$args.arr" }
selection: "$"
)
}