Skip to content

Next Steps #34

@jneurock

Description

@jneurock

I have the idea to separate this addon into multiple libraries by its logical parts. Those being:

  • The ability to automatically resolve types from a given schema.
  • Knowing how to fetch data from Mirage based on fields from a query.

My tentative plan is to create a GraphQL auto-resolver library that expects a resolution strategy to be supplied to it and separately a Mirage auto-resolution strategy. The Ember addon would then become a thin wrapper around these two libraries or it would be deprecated.

I see several advantages here:

  • A standalone GraphQL auto-resolution library might be useful in another context.
  • Separating the logical pieces could mean easier, more focused development of each part.
  • Detaching these capabilities from Ember would ensure compatibility with Mirage itself if it were also detached from Ember.

I've already started experimenting with these ideas. As I spend more time working on the separate libraries the implementation details will become more clear. So far, these are my thoughts:

  • Resolvers should be used instead of mocks. See Use resolvers instead of mocks? #12.
  • An option for custom resolvers should be allowed.
  • The auto-resolver should expect the strategy to have callbacks for resolving GraphQL's built-in types, e.g., GraphQLObjectType, GraphQLInterfaceType, GraphQLList, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions