When working with Apollo Server, you have the ability to define the server's schema by passing a string into gql.
const typeDefs = gql`
type Query {
getBtcRates: [BtcRate]
}
`'
However, it raises the question - what exactly is gql? Is it a function or a method?
The definition of gql:
export const gql: (
template: TemplateStringsArray | string,
...substitutions: any[]
) => DocumentNode = gqlTag;
At first glance, it appears to be a function, though the syntax is unfamiliar. This has sparked my curiosity as to why it is written in this particular manner.