[英]Subgraph on hosted service issue with selecting based on an ethereum address
我在 .graphql 文件中為我的子圖創建了模式,這是一個示例:`
type Post @entity {
id: ID!
title: String! # string
body: String! # string
createdAt: BigInt! # uint256
groupID: BigInt! # uint256
}
type User @entity {
id: ID!
userId: BigInt!
transactionHash: Bytes
telephoneVerifiedData: String
email: String # string
_userAddress: Bytes
}
`
我嘗試為將 _userAddress 字段視為純文本的查詢制作一個模式(我不知道任何其他方式,在文檔中找不到任何內容):
type _Schema_
@fulltext(
name: "getUser"
language: simple
algorithm: rank
include: [
{ entity: "User", fields: [{ name: "userName", name: "_userAddress" }] }
]
)
但我在部署子圖時收到此消息:
✖ Failed to deploy to Graph node https://api.thegraph.com/deploy/: deployment failure::subgraph validation error: [schema validation failed: [FulltextIncludedFieldInvalid("_userAddress")]]
我看到兩個問題。
在全文查詢中,您將userName
指定為要搜索的字段,但它未在您的User
實體中定義。 添加userName: String
到您的User
實體和
其次, _userAddress
的類型是Bytes
。 為了搜索這個字段,它需要是String
類型。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.