api - GraphQL 查询中的空手道变量
问题描述
我正在尝试连接到 GraphQL API 端点,但我收到错误消息:
"message": "Validation error of type UnusedVariable: Unused variable password"
"message": "Validation error of type UnusedVariable: Unused variable username"
这是我的代码:
@first
Feature: check Sign In method by API
Background: setup
* url 'https://ffer232311.appsync-api.us-east-1.amazonaws.com/'
* header Accept = 'application/json'
* header x-api-key = 'dadsfdsfo4'
Scenario: get token for certain user
Given text query =
"""
mutation signIn ($username: String!, $password: String!) {
signIn (username: "<username>", password: "<password>") {
authenticationResult {
AccessToken
ExpiresIn
RefreshToken
IdToken
}
emailVerified
}
}
"""
* replace query.username = 'user1'
* replace query.password = 'pass1'
Given path 'graphql'
And request { query: '#(query)' }
When method post
Then status 200
* print 'response:', response
请看一下并指出我的错误在哪里
解决方案
推荐阅读
- javascript - 使用 NestJS 在 PostgreSQL 数据库中存储文件
- java - 弹簧 WebFlux。控制器调用后如何添加特定逻辑?
- c++ - 带有字符串的c ++ Switch语句不起作用
- apache-spark - 尝试使用 Spark 3.1.2 插入 Hive 表时出错:只能将数据写入具有单个路径的关系
- database - 如何处理 IoTDB 数据库中的“无法从 [[...]] 获取下一个文件夹,因为它们都已满”错误
- json - 使用 JSON 列 postgresql 中的值连接表
- angular - 在 Angular9 中运行 .spec.ts 文件时出现“目标文件”错误
- github-actions - 在当前存储库中找不到任何在线和空闲的自托管运行器
- android - 有没有办法根据查看寻呼机内容图像将android状态栏更改为透明?
- python - 我正在尝试使用 BS4 实现自动化,但我的编辑器没有给我输出。为什么?