Skip to content

Add validation to detect when datafetchers wired on interfaces #3841

Open
@dondonz

Description

@dondonz

A validation idea from @bbakerman

Because type wiring is registered by string name, we allow a data fetcher registration to a field in an interface type because as the time of pre schema building, we don't know its an interface. I guess with more work we could "validate" this once we have the real schema in place and we know all the types

Investigate if we can validate that datafetchers are only wired on concrete types

Potential idea

allow RuntimeWiring building as we have it day (since we have no schema elements yet)
then at "schema generation time" we validate that the values in the graphql.schema.GraphQLCodeRegistry make sense
eg data fetchers only on fields of a concrete type
type resolvers ONLY on non concrete type
all non concrete types have a type resolver
etc...

Metadata

Metadata

Assignees

No one assigned

    Labels

    keep-openTells Stale Bot to keep PRs and issues open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions