Skip to content

How to include graphql-scalars? #7572

Answered by tsongas
tsongas asked this question in Q&A
Feb 23, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

I got some help on Discord, apparently I needed to add references to the scalars, just importing graphql-scalars didn't do that, so I added a scalar.ts file similar to my enum.ts file for enums that gets imported into my schema, and now these scalars work:

import { gql } from 'apollo-server-express'

export const typeDef = gql`
  scalar Date
  scalar DateTime
  scalar Time
  scalar UUID
`

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Urigo
Comment options

@tsongas
Comment options

@Urigo
Comment options

Answer selected by tsongas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants