Skip to content

Why does SchemaMappingInspector doesn't check type mismatches ? #1401

@aynesh

Description

@aynesh

A quick question, why doesn't SchemaMappingInspector doesn't validate if for eg:

Type Query {
      helloWord: String
}

and implementation returns an Int

@Controller
class TestGraphqlController {

    @QueryMapping
    fun helloWord: Int {
        return 123
    }
}

In this case, there is a type mismatch. Although this fails at runtime, earlier detection is better. Is it intentional that users can implement their own Coercing? or any other reason! Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions