Hey Guys. I'm new here. I'm trying to start yoga s...
# orm-help
p
Hey Guys. I'm new here. I'm trying to start yoga server
Copy code
const typeDefs = `
  type Query {
    hello(name: String): String!
  }
`

const resolvers = {
  Query: {
    hello: (_, { name }) => `Hello ${name || 'World'}`,
  },
}

const server = new GraphQLServer({ typeDefs, resolvers })
but I get following { "error": "Unexpected token < in JSON at position 0" } Any help? Thanks
r
@Pavel Vorontsov 👋 I’m not sure what’s causing this error, but I would suggest switching to Apollo Server as GraphQL Yoga isn’t supported anymore. https://www.howtographql.com/graphql-js/0-introduction/ This should help you setup Apollo Server for GraphQL 🙂
p
Thank you Ryan. Got it. Just started watching video tutorial with yoga-server and didn't research that it's not supported.
r
Which tutorial are you watching? There’s a possibility it might be outdated
p
Most likely it's is. The Modern GraphQL Bootcamp (with Node.js and Apollo) Udemy
r
Yup that’s outdated and uses Prisma 1. You can follow howtographql on the above link and this one that uses the latest version of Prisma.
p
Thanks again!
💯 1
🙌 1