happiness (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) happiness

GraphQL

graphqlのpagenationの引数afterについて

afterで指定するのがnodeのidではなく、PageInfo.endCursorの値になる。 勝手にやってくれるので忘れてしまうのでメモ。 query getPosts($cursor: String) { posts(first: 10, after: $cursor) { nodes { ...PostFragment } pageInfo { hasNextPage endCurso…

GraphQLのEnumのエラーの解消

状況 Railsで以下graphql-rubyを使っている https://graphql-ruby.org/ create mutationの payloadで Enumを参照しようとした時に発生 mutation { createAbc { input: { reason: a } }, { abc { reason } } enum AbcEnum { a b c } エラー内容 GraphQL::Enum…