Ive added a picture field to Users which shows up ...
# orm-help
j
Ive added a picture field to Users which shows up fine in the Prisma playground but in React it always comes back null, but if I query other fields its fine. Im really confused why this isnt working, have I made a syntax error? datamodel.graphql:
Copy code
type User {
  id: ID! @unique
  picture: String
}
schema.graphql:
Copy code
type User {
  id: ID!
  picture: String
}


type Query {
  user(id: ID!): User
}
My resolver:
Copy code
async user(parent, args, ctx, info) {
    const { id } = args;
    const result = await ctx.db.query.user({ where: { id } }, info);
    return result;
  },
React component:
Copy code
export const USER_QUERY = gql`
  query UserQuery($userId: ID!) {
    user(id: $userId) {
      id
      picture
    }
  }
`;

export default compose(
  graphql(USER_QUERY, {
    name: 'USER_QUERY',
    options: props => {
      return {
        variables: {
          userId: 'cjgylfv6y004h0958tx9d8j9v',
        },
      };
    },
  }),
)(UserPic);