GraphQLError:语法错误:预期的:,找到{

时间:2018-08-16 12:46:26

标签: graphql apollo

这是我的graphql查询/突变。

我遇到了错误: GraphQLError:语法错误:预期的:,找到{

我不知道其中哪一个是错误的。

import gql from 'graphql-tag';

export const CategoriesQuery = gql`
    query categoriesQuery(
        $id: ID!,
        $country: String!,
        $name: String!
    ) {
        sections(
            id: $id,
            country: $country,
            name: $description
        ) {
            id,
            createdBy,
            createdDate,
            lastUpdate,
            name
        }
    }
`;

export const ItemsQuery = gql`
    query itemsQuery(
        $id: ID!,
        $category: String!,
        $url: String!,
        $alias: String!,
        $name: String!
    ) {
        items(
            input {
                id: $id,
                category: $category,
                url: $url,
                alias: $alias,
                name: $name
            }
        ) {
            id,
            createdBy,
            createdDate,
            lastUpdate,
            name,
            category,
            url,
            alias,
            description
        }
    }
`;

export const AddCategoryMutation = gql`
    mutation ($category: CategoryInput!) {
        addCategory(category: $category) {
            id
        }
    }
`;

export const AddItemMutation = gql`
    mutation ($item: ItemInput!) {
        addItem(item: $item){
            id
        }
    }
`;

1 个答案:

答案 0 :(得分:4)

这是第二个查询。您需要更改此

items(
  input: {
      id: $id,
      category: $category,
      url: $url,
      alias: $alias,
      name: $name
  }
)

对此:

input

=Join(LookupSet(Fields!ReportUNC.Value, Fields!ReportUNC.Value, Format(Fields!cntSelfService.Value, "###,#######0"), "ExecutionCount"))之后添加冒号