Sha256: 6794e7db869889c10a7a38a5e4ebbd547a825d3a837de60acdb41d2c95b1b6cd
Contents?: true
Size: 1.06 KB
Versions: 34
Compression:
Stored size: 1.06 KB
Contents
require "spec_helper" describe GraphQL::Schema::TypeExpression do let(:schema) { DummySchema } let(:ast_node) { document = GraphQL.parse("query dostuff($var: #{type_name}) { id } ") document.definitions.first.variables.first.type } let(:type_expression_result) { GraphQL::Schema::TypeExpression.build_type(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_result) 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_result) 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_result) end end end end
Version data entries
34 entries across 34 versions & 1 rubygems