I was looking for documentation of Graphql client Apollo
, here I've got that the query is a string but inside backticks, what does the gql
prefix means before the query string? My question is regarding the syntax
import { useQuery, gql } from '@apollo/client';
const EXCHANGE_RATES = gql`
query GetExchangeRates {
rates(currency: "USD") {
currency
rate
}
}
`;
I've seen same type of syntax for styled components.
import { styled } from "@styles";
export const Content = styled.div`
text-transform: none;
font-size: ${props => props.theme.typography.h4FontSize};
text-align: center;
vertical-align: center;
display: flex;
align-items: center;
flex-direction: column;
`;