错误:与数据源关联的解析程序
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了错误:与数据源关联的解析程序相关的知识,希望对你有一定的参考价值。
我从serverless.yml配置文件构建时遇到无服务器错误:Resolver associated with data sources
:
# serverless.yml
...
mappingTemplates:
- dataSource: Wallet
type: Query
field: walletFromId
request: "_dynamo-get-wallet.txt"
response: "_generic-result-response.txt"
- dataSource: Wallet
type: Query
field: walletsFromUser
request: "_dynamo-get-wallets-from-user.txt"
response: "_generic-result-response.txt"
- dataSource: Wallet
type: Mutation
field: registerWallet
request: "_dynamo-put-wallet.txt"
response: "_generic-result-response.txt"
dataSources:
- type: AMAZON_DYNAMODB
name: Wallet
description: 'Wallet DataSource'
config:
tableName: "${self:custom.stage}-Wallet"
serviceRoleArn: "arn:aws:iam::${self:custom.accountId}:role/${self:custom.appSync.serviceRole}"
...
我还有一个schema.graphql:
type Query {
# query the wallet with given id and get the output with detail info
walletFromId(walletId: String!): Wallet!
# query wallets with given user id and get list of cards
walletsFromUser(userId: String!): [Wallet!]!
}
type Mutation {
# Add a wallet to an existing user
registerWallet(userId: String!, number: String!, cvx: String!, expirationDate: String!): Wallet!
}
type Wallet {
walletId: String!
userId: String!
number: String!
cvx: String!
expirationDate: String!
}
type Subscription {
addWallet: Wallet
@aws_subscribe(mutations: ["registerWallet"])
}
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
我找不到一个关于这个错误意味着什么的线索,而且我从构建日志中找不到任何其他东西。
答案
此错误通常意味着您正在尝试删除解析程序当前正在使用的数据源。如果您可以识别指向数据源的解析程序并将其删除,那么您将不再看到错误消息。
以上是关于错误:与数据源关联的解析程序的主要内容,如果未能解决你的问题,请参考以下文章
EF添加关联的提示问题:映射从第 260 行开始的片段时有问题:
无法解析片段中的 ViewModelProvider 构造?