Hi,
First, thanks for the awesome documentation!
I read the custom resolver doc and currently I’m thinking which approach would be the best to achieve such a query
query {
interfaces {
implementations(filter: {
requirementsSatisfiedBy: [
{
typeRef: {
path: "cap.core.type.platform.kubernetes", revision: "1.0.1",},
value: "{\"version\": \"1.18.9\"}"
}
]
}) {
name
}
}
}
I have such a schema:
type InterfaceRevision {
id: ID!
metadata: GenericMetadata!
revision: String! @search(by: [exact, regexp])
spec: InterfaceSpec!
"""
List Implementations for a given Interface
"""
implementations: [Implementation!] # here I want to have a custom resolver with my own filters
}
Without any customization, I can query any data using queryInterfaceRevision
query but just for the implementations
I want to have a custom resolver that will be able to provide additional business filters.
I do not want to create a totally new query as described here, as it is not needed, only this particular field needs to be resolved differently (only if additional filters are specified).
Is there an option to use @custom(dql: ...)
on the filed? If not, how can I execute a custom query that calls back the same Dgraph instance using @custom(http:.. )
and DQL?
EDIT:
I checked version from master and the @custom(dql: ...)
directive cannot be used: @custom directive with
dql can be used only on queries
, so only the @custom(http:.. )
is an option?
Cheers,
Mateusz