Currently, there is one level of encapsulation,
wikimedia.org/1.0.0/swagger.yaml
is wrapped in wikimedia
healthcare.gov/1.0.0/openapi.yaml
is wrapped in healthcare
:
.meshrc.yaml
contains this definitions:
sources:
- name: Wikimedia
handler:
openapi:
source: https://api.apis.guru/v2/specs/wikimedia.org/1.0.0/swagger.yaml
transforms:
- prefix:
value: Wikimedia_
- encapsulate:
name: wikimedia
applyTo:
query: true
mutation: false
subscription: false
- name: Healthcare
handler:
openapi:
source: https://api.apis.guru/v2/specs/healthcare.gov/1.0.0/openapi.yaml
transforms:
- prefix:
value: Healthcare_
- encapsulate:
name: healthcare
applyTo:
query: true
mutation: false
subscription: false
This .meshrc.yaml
generates this root level Query type:
type Query {
healthcare: healthcareQuery
wikimedia: wikimediaQuery
}
To execute this query I run
query currentQuery {
healthcare {
getApiArticlesMediaTypeExtension(mediaTypeExtension: _JSON) {
articles {
date
}
}
}
wikimedia {
getFeedAvailability {
inTheNews
}
}
}
My question is how to modify this example to wrap fields wikimedia
and healthcare
in NestedType
like this:
type NestedType {
healthcare: healthcareQuery
wikimedia: wikimediaQuery
}
type Query {
nestedType: NestedType
}
So I could query this schema by:
query desiredQuery {
nestedType {
healthcare {
getApiArticlesMediaTypeExtension(mediaTypeExtension: _JSON) {
articles {
date
}
}
}
wikimedia {
getFeedAvailability {
inTheNews
}
}
}
}