all files / semantic-graphql/src/graphql/ getGraphqlScalarType.js

87.5% Statements 7/8
50% Branches 1/2
100% Functions 1/1
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13            
const { graphqlScalarTypes } = require('../scalars');
const getIriLocalName = require('../utils/getIriLocalName');
 
function getGraphqlScalarType(g, iri) {
  const type = graphqlScalarTypes[getIriLocalName(iri)];
 
  Iif (!type) throw new Error(`getGraphqlScalarType ${iri})`);
 
  return type;
}
 
module.exports = getGraphqlScalarType;