Skip to content

Custom scalars helper method? #568

Answered by hayes
haleksandre asked this question in Q&A
Discussion options

You must be logged in to vote

This doesn't exist as an official feature right now, but it's possible to extend things yourself. The types involved in doing this correctly are fairly complex though because of interactions with various plugins.

You should be able to just use the following (and modify the list of custom scalars at the top to suite your needs). You can put this in a file, and simply import it from the file that creates your builder:

import {
  CompatibleTypes,
  FieldBuilder,
  FieldKind,
  FieldNullability,
  FieldOptionsFromKind,
  FieldRef,
  InputFieldMap,
  NormalizeArgs,
  OutputType,
  RootFieldBuilder,
  SchemaTypes,
  ShapeFromTypeParam,
} from '@pothos/core';

// Add scalar types here to create …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by haleksandre
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