import { IntValueNode } from "graphql/language" ; import { IConvertContext } from "../../IConvertContext" ; import { IConvertSettings } from "../../IConvertSettings" ; import { Util } from "../../Util" ; import { IValueNodeHandlerOutput , NodeValueHandlerAdapter } from "./NodeValueHandlerAdapter" ; import * as RDF from "@rdfjs/types" ; /**
 * Converts GraphQL ints to RDF integer terms.
 */ export class NodeValueHandlerInt extends NodeValueHandlerAdapter < IntValueNode > { protected readonly datatype : RDF . NamedNode ; constructor ( util , settings ) { super ( 'IntValue' , util , settings ) ; this . datatype = this . util . dataFactory . namedNode ( 'http://www.w3.org/2001/XMLSchema#integer' ) ; } public handle ( valueNode , fieldName , convertContext ) { return { terms : [ this . util . dataFactory . literal ( valueNode . value , this . datatype ) ] } ; } }