graphql-filter-field
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

graphql-filter-field

filter any field on Schema not just root field

Install

yarn add graphql-filter-field

Usage

filterFields passes through all GraphQL type.

const typeDefs = `
  type User {
    id: ID
    fullName: String
    hello_delete: String
  }
 
  type Query {
    users: [User]
  }
`
const schema = makeExecutableSchema({ typeDefs })
addMockFunctionsToSchema({ schema })
const newSchema = filterFields(schema, (field) => {
  return field.name.endsWith('_delete')
})

Package Sidebar

Install

npm i graphql-filter-field

Weekly Downloads

12

Version

0.1.1

License

MIT

Unpacked Size

144 kB

Total Files

11

Last publish

Collaborators

  • komcal