In the version 3 of apollo server, we could use import {gql} from "apollo-server-express"
to create typedefs and schemas. But in v4 of apollo server, apollo-server-express and apollo-server-core
are depreciated and will be removed. So, instead of importing gql
from apollo-server-express
, how can we import gql
I tried import gql
from new @apollo/server
and it is not working either.
import { gql } from "@apollo/server";
const typeDefs = gql``;
CodePudding user response:
With Apollo v4 you should now import qgl
from the graphql-tag package.
import gql from 'graphql-tag';