Sha256: 23784d140956323c1dccd35351296a32521a10401305c2049658de3e1b08569f
Contents?: true
Size: 1019 Bytes
Versions: 14
Compression:
Stored size: 1019 Bytes
Contents
require "spec_helper" describe GraphQL::Schema::TypeExpression do let(:schema) { DummySchema } let(:ast_node) { ast = GraphQL::PARSER.type.parse(type_name) GraphQL::TRANSFORM.apply(ast) } let(:type_expression) { GraphQL::Schema::TypeExpression.new(schema, ast_node) } describe "#type" do describe "simple types" do let(:type_name) { "DairyProductInput" } it "it gets types from the schema" do assert_equal(DairyProductInputType, type_expression.type) end end describe "non-null types" do let(:type_name) { "String!"} it "makes non-null types" do assert_equal(GraphQL::STRING_TYPE.to_non_null_type, type_expression.type) end end describe "list types" do let(:type_name) { "[DairyAnimal!]!" } it "makes list types" do expected = DairyAnimalEnum .to_non_null_type .to_list_type .to_non_null_type assert_equal(expected, type_expression.type) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems