我是graphql的新手,我正在努力查询.我想通过他们的电子邮件地址返回用户
我有一个类型定义的调用V1User,它有以下字段id,email,password,role
在此查询中需要更改哪些内容才能根据电子邮件返回用户?
query GetAllV1User {
viewer {
allV1Users{
edges {
node {
id
email
role
createdAt
modifiedAt
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我试过这个查询
query getV1UserQuery($email: String!) {
getV1User(email: $email) {
id
email
}
}
Run Code Online (Sandbox Code Playgroud)
有了这些参数
{"email": "test@test.com"}
Run Code Online (Sandbox Code Playgroud)
但是得到以下错误
{
"errors": [
{
"message": "Unknown argument \"email\" on field \"getV1User\" of type \"Query\".",
"locations": [
{
"line": 2,
"column": 13
}
],
"name": "GraphQLError"
},
{
"message": "Field \"getV1User\" argument \"id\" of type \"ID!\" is required but not provided.",
"locations": …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Amazon Lambda上部署Spring Boot应用程序.我注意到如果快速连续调用处理程序 - spring尝试重新加载自己,重新设置datsources,重新加载bean等
无论如何,如果已经调用了main方法,那么告诉Spring Boot不要重新初始化它?
谢谢Damien
我试图在Spring MVC中休息我的休息课
如果我运行以下代码(当项目很小但现在失败时可以运行),它将尝试加载应用程序中的所有不同组件。这包括与外部系统交互并需要凭据才能连接的bean
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class TestDummyRest extends BaseRestTestCase{
@Autowired
private MockMvc mockMvc;
@MockBean
private IDummyServices mockDummyServices;
@Test
public void getSendGoodMessage() throws Exception {
given(mockDummyServices.sendGoodMessage(Mockito.anyString())).willReturn(true);
mockMvc.perform(get("/dummy"))
.andExpect(status().isOk())
.andExpect(content().contentType(TEXT_PLAIN_CONTENT_TYPE));
verify(mockDummyServices, times(1)).sendGoodMessage(Mockito.anyString());
}
}
Run Code Online (Sandbox Code Playgroud)
如何告诉测试类不要加载应用程序的@Configuration或@Component类?