假设我有以下 json 数据:
"data": {
"continents": [
{
"code": "AF",
"name": "Africa",
},
{
"code": "EU",
"name": "Europe"
},
// ...
]
}
Run Code Online (Sandbox Code Playgroud)
使用以下命令获取列表项的正确 GraphQL 查询是什么: code : "AF"?换句话说,如何产生以下结果:
"data": {
"code": "AF",
"name": "Africa"
}
Run Code Online (Sandbox Code Playgroud)
到目前为止,我有:
query {
continents {
code
name
}
}
Run Code Online (Sandbox Code Playgroud)
但这只是返回完整的数组。
我一直在以下位置运行我的示例: https: //lucasconstantino.github.io/graphiql-online/
我npm start在我的 Angular 项目中遇到了一个问题(我附上了错误的截图)。
当我使用 运行项目时ng serve,一切正常。
我尝试了几种方法来解决这个问题,但没有成功。
这是我的package.json文件:
{
"name": "myapplication",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~11.0.6",
"@angular/common": "~11.0.6",
"@angular/compiler": "~11.0.6",
"@angular/core": "~11.0.6",
"@angular/forms": "~11.0.6",
"@angular/platform-browser": "~11.0.6",
"@angular/platform-browser-dynamic": "~11.0.6",
"@angular/router": "~11.0.6",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.6",
"@angular/cli": "~11.0.6",
"@angular/compiler-cli": "~11.0.6",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": …Run Code Online (Sandbox Code Playgroud) 我正在尝试让 Telegraf 与 InfluxDB 一起使用,但我遇到了困难。我已将以下块添加到 Telegraf 配置文件中:
[[inputs.win_perf_counters.object]]
# Process metrics, in this case for IIS only
ObjectName = "Process"
Instances = ["W3SVC"]
Counters = ["% Processor Time","Handle Count","Private Bytes","Thread Count","Virtual Bytes","Working Set"]
Measurement = "win_proc"
Run Code Online (Sandbox Code Playgroud)
然而,当我搜索数据库时,我从未看到该测量结果。我知道该进程正在运行,所以它应该输出一些东西。问题是,即使我打开了日志记录,也没有日志文件。事件查看器中也没有任何内容。由于没有下载源代码并在本地调试器中运行程序,我不知道如何继续。有人有什么想法吗?
我正在尝试调用部署在远程服务器上的无状态EJB.我可以从我的本地JBoss环境调用bean,但是当我将其更改remote.connection.default.host为远程机器的主机时,我的客户端代码不起作用.
这是我的jboss-ejb-client.properties:
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=SERVERIP/HOSTNAME
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.username=username
remote.connection.default.password=Password
Run Code Online (Sandbox Code Playgroud)
我的客户端代码如下所示:
Properties properties = new Properties();
properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
String jndi = "jndi_name";
Context context = new InitialContext(properties);
obj = context.lookup(jndi);
Run Code Online (Sandbox Code Playgroud)
请帮忙.
谢谢大家.插口.
在我的 .NET 中project,我试图在该工具生成的文档文件中包含指向模块化 Java 库 ( Caesar ) 的链接javadoc。跑步:
mvn clean install
Run Code Online (Sandbox Code Playgroud)
构建没有链接到外部库的文档。
我的配置:
project
|-- pom.xml
`-- src
`-- main
`-- java
|-- foo.bar.project
| `-- foo
| `-- bar
| `-- project
| `-- Foo.java
`-- module-info.java
Run Code Online (Sandbox Code Playgroud)
Foo.java:
package foo.bar.project;
import com.github.glusk.caesar.Bytes;
public class Foo {
public static Bytes bytes;
}
Run Code Online (Sandbox Code Playgroud)
module-info.java:
module foo.bar.project {
requires com.github.glusk.caesar;
}
Run Code Online (Sandbox Code Playgroud)
pom.xml:
package foo.bar.project;
import com.github.glusk.caesar.Bytes;
public class Foo {
public static Bytes bytes; …Run Code Online (Sandbox Code Playgroud) java javadoc maven java-platform-module-system maven-javadoc-plugin
我对这段代码有疑问。当我在终端 docker-compose up --build 中写入时。终端向我显示这个问题:
C:\Users\ingbr\OneDrive\Documentos\Server Minecraft> docker-compose up --build
services.minecraft-server Additional property args is not allowed
Run Code Online (Sandbox Code Playgroud)
我找不到解决办法
C:\Users\ingbr\OneDrive\Documentos\Server Minecraft> docker-compose up --build
services.minecraft-server Additional property args is not allowed
Run Code Online (Sandbox Code Playgroud) 这是为 GitHub 问题评论设置操作触发器的方式.github/workflows/main.yml:
on:
issue_comment:
types: [created, edited]
Run Code Online (Sandbox Code Playgroud)
我假设我也可以阅读里面的问题评论main.yml并将其作为输入参数传递给我的操作。
我如何实际阅读问题评论body?
我有一个简单的 React 应用程序,其父组件具有进行 xhr 调用的功能。该函数被传递给一个子组件,该子组件的工作是从用户收集一些信息,然后在提交按钮上调用 prop 处理程序。然后调用父级中的函数。一切都很好,为我工作。
我已经测试了孩子,以确保单击按钮会导致处理程序被触发。效果很好。
现在我想测试父级中的实际处理程序代码。我怎样才能做到这一点?我在父级中没有可以触发的事件,而这发生在子级中。
我意识到我没有很好地解释这一点。我正在使用 @testing-library/react 和玩笑。
我真的只是想测试恰好位于该组件内部的js代码。我看到的一个建议是从组件中提取这个函数,将其导出,然后以这种方式进行测试。但是这段代码修改了父组件状态,所以我不知道如何将其抽象出来。
我所拥有的代码很少,抱歉:
describe('Testing Parent Component', () => {
const setup = () => {
render(<Parent />);
};
test('child click event fires', async () => {
// here I want to mock the child firing the Parent's handler function
});
});
Run Code Online (Sandbox Code Playgroud)
这是一些伪父组件代码:
import React, { useEffect } from 'react';
import Child from './child';
const Parent = () => {
const [queueStatus, setQueueStatus] = React.useState([]); …Run Code Online (Sandbox Code Playgroud) 我正在使用 React.js、node 和 socket.io 创建一个聊天应用程序。对于最初的 2-3 个请求,它工作得绝对正常,但之后设备就会无限挂起。
我认为问题出在我的代码逻辑上。这是我的前端:
import React from "react";
import SendIcon from "@material-ui/icons/Send";
import "./chat.css";
import queryString from "query-string";
import { useEffect } from "react";
import { userName, roomId } from "./login.jsx";
import { useLocation } from "react-router-dom";
import { useState } from "react";
import chat from "./chat.svg";
import TextField from "@material-ui/core/TextField";
import AccountCircleSharpIcon from "@material-ui/icons/AccountCircleSharp";
import FingerprintSharpIcon from "@material-ui/icons/FingerprintSharp";
import io from "socket.io-client";
let socket;
function Chat() {
let [name, setName] = useState();
let [room, setRoom] …Run Code Online (Sandbox Code Playgroud) 我试图在 React 中访问 commercejs 库的公钥。但我没有这样做并遇到了这个错误。我不明白为什么我会收到此错误。
src\lib\commerce.js
import Commerce from '@chec/commerce.js';
export const commerce = new Commerce(process.env.REACT_APP_CHEC_PUBLIC_KEY, true);
Run Code Online (Sandbox Code Playgroud)
src\App.js
import React, {useState, useEffect} from 'react';
import {Products, Navbar} from './components';
import {commerce} from './lib/commerce';
const App = () => {
const [products, setProducts] = useState([]);
const fetchProducts = async () => {
const {data} = await commerce.products.list();
setProducts(data);
}
useEffect(() => {
fetchProducts();
})
console.log(products);
return (
<div>
<Navbar/>
<Products/>
</div>
)
}
export default App;
Run Code Online (Sandbox Code Playgroud)
错误
类型错误: t 未定义 e …
reactjs ×3
java ×2
angular ×1
angular-cli ×1
commerce.js ×1
docker ×1
ejb ×1
graphql ×1
influxdb ×1
java-platform-module-system ×1
javadoc ×1
javascript ×1
jboss ×1
maven ×1
npm ×1
npm-install ×1
telegraf ×1
typeerror ×1
undefined ×1
wildfly-8 ×1