Summary
We are using Slash as our hosted Dgraph Server. But we have been facing a slight issue with using it.
So we update our Slash schema using the updateGQLSchema
mutation (as mentioned in the docs). And the schema does get updated correctly, as we can cross-check that on the Schema Editor page. But when we take a look at the predicates (using Ratel), all of them are not there. Some fields on some types do not have any corresponding predicate. This leads to an error being thrown whenever we try to add some data on those predicates.
More Details
A snippet of the relevant part of our schema:
interface Node @generate(
query: {get: true, query: false, aggregate: false},
mutation: {add: false, update: false, delete: false}
) {
id: ID!
}
interface ProductChildNode @generate(
query: {get: false, query: false, aggregate: false},
mutation: {add: false, update: false, delete: false}
) {
product: Product!
}
type Product implements Node @generate(
query: {query: false},
mutation: {add: false, update: false, delete: false}
) {
id: ID!
name: String! @id @search(by: [term])
articles: [Article!]! @hasInverse(field: "product")
}
type Article implements Node & ProductChildNode @generate(
query: {query: false},
mutation: {add: false, update: false, delete: false}
) {
id: ID!
title: String!
product: Product!
}
This is a simple schema with a Product having multiple Articles, and each Article pointing back to its Product.
The schema does get updated correctly, but we can’t see the predicate Article.Product
on Ratel. This becomes a blocker because we use the pydgraph
client to add data to Dgraph, and whenever we try to add an Article.product
, it throws this error:
<_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Schema not defined for predicate: Article.product."
debug_error_string = "{"created":"@1612809947.370362755","description":"Error received from peer ipv4:15.207.255.202:443","file":"src/core/lib/surface/call.cc","file_line":1067,"grpc_message":"Schema not defined for predicate: Article.product.","grpc_status":2}"
>
Additional Notes
- This is happening for around 3 to 5 fields in our schema.
- Keeping the whole setup exactly the same, we do not face this issue when using
dgraph/standalone:v20.11.0
image as our dgraph server. The issue only occurs when we switch to use Slash.
Would be great if anyone could help in resolving this issue.