Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema Stitching and workaround for Root Type (_: Boolean) #1577

Closed
frederikhors opened this issue Aug 26, 2018 · 1 comment
Closed

Schema Stitching and workaround for Root Type (_: Boolean) #1577

frederikhors opened this issue Aug 26, 2018 · 1 comment

Comments

@frederikhors
Copy link

I'm starting to use Schema Stitching with Apollo Server.

I'm using a file like this:

rootTypes.js:

const { gql } = require('apollo-server')

const UserType = require('./user')

const RootType = gql`
  type Query {
    _: Boolean
  }

  type Mutation {
    _: Boolean
  }
`

module.exports = [RootType, UserType]

and a types/user.js:

const { gql } = require('apollo-server')

const type = gql`
  extend type Query {
    me: User
  }

  type User {
    id: ID!
    email: String!
  }
`

module.exports = type

Is there a way to avoid the use of: _: Boolean for the Root Type?

It is not elegant and I think error prone.

Is there a way to extend without using it?

@jasonpaulos jasonpaulos added the 🚧👷‍♀️👷‍♂️🚧 in triage Issue currently being triaged label Jul 8, 2019
@jasonpaulos
Copy link

Hi @frederikhors, thanks for reporting this issue originally. Schema stitching is now deprecated in favor of federation, which you can learn more about here: https://www.apollographql.com/docs/apollo-server/federation/migrating-from-stitching/

Federation is a much more natural way for schemas to work together, which does not involve any dummy root types. Please reach out to the Apollo Federation channel within the Apollo community on Spectrum.chat if you have any further questions. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants