我正在尝试在新的React项目中设置Apollo GraphQL支持,但是当我尝试使用编译查询时,gql我一直收到错误消息:
Syntax Error: Expected Name, found }
这是由以下代码生成的:
import gql from 'graphql-tag'
const query = gql`
{
user(id: 5) {
firstName
lastName
}
}
`
console.log(query)
Run Code Online (Sandbox Code Playgroud)
我将此代码基于此处的示例代码:https : //github.com/apollographql/graphql-tag
什么是Name错误消息称?有人知道我在做什么错吗?
我在单一存储库中有这个大型打字稿项目,使用yarn workspaces并lerna具有以下架构:
repo
??? API
? ??? (GraphQL API)
??? Apps
? ??? (Front-end React Apps)
??? Libs
? ??? (Shared libraries)
??? Services
??? (Back-end Services)
Run Code Online (Sandbox Code Playgroud)
我package.json看起来像:
{
...
"workspaces": [
"API/**/*",
"Apps/**/*",
"Libs/**/*",
"Services/**/*",
],
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "lerna run build"
}
...
}
Run Code Online (Sandbox Code Playgroud)
我的lerna.json样子:
{
"lerna": "2.11.0",
"npmClient": "yarn",
"useWorkspaces": true,
"workspaces": [
"Libs/**/*",
"API/**/*",
"Apps/**/*",
"Services/**/*"
],
"version": "1.0.0"
}
Run Code Online (Sandbox Code Playgroud)
现在我需要Libs在两者之前构建所有共享Apps, …
我clientMutationId在文档中看到了字段-https: //developer.github.com/v4/guides/migrating-from-rest/#example-strong-typing
什么clientMutationId意思 我该如何生成?
使用 GitHub 的 GraphQL API (v4),如何查询给定存储库的顶级贡献者?我有一个存储库列表,我想显示每个存储库的一些相关数据——即列表中每个存储库的前 5 个贡献者(基于提交)。
这是我当前的查询:
{
organization(login: "the-road-to-learn-react") {
id
repositories(first: 20) {
edges {
node {
collaborators(affiliation: ALL) {
edges {
node {
name
}
}
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我遇到了错误:“必须具有推送访问权限才能查看存储库协作者”。我的想法是获取每个存储库的所有合作者,然后查询每个用户对存储库做出的贡献数量。如何才能做到这一点?有没有办法在不查询存储库合作者的情况下做到这一点?
我正在尝试编写一个函数来处理mouse和touch事件。通过结合两个接口React.TouchEvent和React.MouseEvent,例如:
onStart = (event: React.TouchEvent | React.MouseEvent) => {
event.persist();
console.log('event ', event);
if (event.touches) {
console.log(event.touches);
}
if (event.screenX) {
console.log(event.screenX);
}
};
Run Code Online (Sandbox Code Playgroud)
日志给了我预期的输出,我没有收到任何控制台错误,它按照我的预期运行。但是我的编辑器出现错误:
错误:(94, 22) TS2339:属性“screenX”不存在于类型“MouseEvent | 触摸事件'。“TouchEvent”类型上不存在属性“screenX”。
和
错误:(90, 13) TS2339:“MouseEvent |”类型上不存在“touches”属性 触摸事件'。“MouseEvent”类型不存在“touches”属性。
我该如何使用这两种intefacesReact.TouchEvent并React.MouseEvent没有这一切的错误?
我在graphql查询中遇到了以上错误,我正在顺便起诉apollo-react,并使用Query组件呈现数据
这是我的代码
const GET_VEHICLE_CHECKS = gql`
query getVehicleChecks($uuid: String!) {
tripDetails(uuid: $uuid){
departmentAssigned{
vehicleChecks{
conditions{
id
name
standard
valueType
spinnerItems
}
}
}
}
`;
Run Code Online (Sandbox Code Playgroud)
这就是我的实际查询
{
tripDetails(uuid: "c0e7233093b14afa96f39e2b70c047d8"){
departmentAssigned{
vehicleChecks{
conditions{
id
name
standard
valueType
spinnerItems
}
}
}
vehicleConditions{
id
condition{
id
standard
}
value
}
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试更改变量名称,但这没有用
我们如何在 springboot graphql-server app 中设置基本url。默认情况下,graphiqlapi 控制台打开于 api 控制台在http://localhost:8080/graphiql
尝试通过邮递员使用 post 查询访问http://localhost:8080 ,如下所示:
{
bookings {
name
}
}
Run Code Online (Sandbox Code Playgroud)
给出一个错误说:
{
"timestamp": 1549913598497,
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/"
}
Run Code Online (Sandbox Code Playgroud)
在sdkmanager使用命令行界面运行安装或更新 Android SDK 的命令时,我总是得到一个进度条。
问题是当运行 docker build 时,SDK 的安装会接管日志并记录所有进度条。
我正在使用版本中的这个sdkmanager命令sdk-tools-linux-4333796.zip,我没有设置标志--verbose。
有没有办法让命令静默运行,没有进度条?
graphql ×5
github-api ×2
graphql-tag ×2
react-apollo ×2
typescript ×2
android ×1
apollo ×1
build ×1
lerna ×1
react-tsx ×1
reactjs ×1
relay ×1
spring-boot ×1
syntax-error ×1
yarnpkg ×1