Code Monkey home page Code Monkey logo

Comments (7)

mickhansen avatar mickhansen commented on July 3, 2024

It's really just figuring out what they should map to i suppose.
I wanted to do JSONB but the closests is GraphQLObjectType and that needs a subset of fields, so you'd really look to define subfields for the JSONB which Sequelize doesn't support atm (but we've talked about doing sub schemas), we did something similar for VIRTUAL to support returnType to make VIRTUAL work with GraphQL.

ENUM should probably just map to a GraphQLString? That should be a trivial fix.

from graphql-sequelize.

aweary avatar aweary commented on July 3, 2024

I'll have to think about JSONB but ENUM should probably map to the GraphQLEnumType

from graphql-sequelize.

mickhansen avatar mickhansen commented on July 3, 2024

Oh yeah if there's an GraphQLEnumType definitely map to that.

from graphql-sequelize.

aweary avatar aweary commented on July 3, 2024

I can get a pull request in to add GraphQLEnumType support.

As for JSONB I'm not seeing any real way to do it unless Sequelize supports sub-schemas. The fields have to come from some where. One options that might work is adding a field to the options parameter that can define field values, like:

const fields = {
  data: {
    name: GraphQLString,
    id: GraphQLInt
  }
}

attributeFields(Model, { fields: { data: fields }}

But I don't know, there doesn't seem to be any advantage using that over just using exclude and defining the properties yourself and merge with _.assign

from graphql-sequelize.

aweary avatar aweary commented on July 3, 2024

#15 adds support for ARRAY and ENUM, though JSONB is still not supported yet.

from graphql-sequelize.

mickhansen avatar mickhansen commented on July 3, 2024

@aweary Sequelize doesn't support sub schemas at the moment.

from graphql-sequelize.

mickhansen avatar mickhansen commented on July 3, 2024

JSONB will have to be solved with exclude + custom type at the moment

from graphql-sequelize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.