用Graphql速记语言编写连接?

时间:2016-11-07 22:05:34

标签: graphql relayjs relay graphql-js

你会如何用graphql 0.7简写写一个连接?

我看到列表可以像这样写出

var schema = buildSchema(`
  type Query {
    list: [Int]
  }
`);

但我看不到任何关于如何使用简写来编写连接的文档?是目前准备用于中继的简写语法吗?

扩展问题 - 你会如何使用简写语法编写? / root query。

var userType = new GraphQLObjectType({
  name: 'User',
  description: 'A person who uses our app',
  fields: () => ({
    widgets: {
      type: widgetConnection,
      description: 'A person\'s collection of widgets',
      args: connectionArgs,
      resolve: (_, args) => connectionFromArray(getWidgets(), args),
    },
  }),
  interfaces: [nodeInterface],
});

0 个答案:

没有答案