Git Product home page Git Product logo

fastgql's People

Contributors

dependabot[bot] avatar mpieczaba avatar roneli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fastgql's Issues

Is it a waste when we scan from db into struct?

Can we modify/config gqlgen to just return interface{} instead?

var data []*model.User
if err := pgxscan.ScanAll(&data, rows); err != nil {
  return nil, err
}

Here from the example, we need to marshal the whole list of User struct, even if the request only ask for id/name. If this can just return interface{} then we dont need to marshal, only raw data from db it can be more optimal?

GraphQL directives not applied

Hi

I'm trying to apply fastgql directive (@tableName) in my graphql schema file like so:

type UserProfile @generateFilterInput(name: "UserProfileFilterInput") @tableName(name: "myapp.user_profile") {
    userID:  ID! @sqlRelation(relationType: ONE_TO_ONE, baseTable: "myapp_private.user_account", refTable: "janaez.user_profile", fields: ["id"], references: ["user_id"])
    firstname: String
    lastname: String
    displayname: String!
    createdAt: Time
    updatedAt: Time
    nationality: Country @sqlRelation(relationType: ONE_TO_ONE, baseTable: "myapp.country", refTable: "myapp.user_profile", fields: ["id"], references: ["nationality_id"])
}

type UserProfilePayload {
    userID:  ID!    # userAccount.id
    firstname: String
    lastname: String
    displayname: String
    createdAt: Time
    updatedAt: Time
    nationality: Country
}

input UserProfileQueryInput {
    firstname: String
    lastname: String
    displayname: String
    nationalityID: Int
}

...and declared my GraphQL Query like so:

type Query {
#   UserProfile
    users(input: UserProfileQueryInput): [UserProfilePayload!]!
}

The problem:
When I run the GraphQL playground and try my query statement like this:

query GetAllUsers {
  users{
    userID
    firstname
    lastname
    displayname
    createdAt
    updatedAt
    nationality {
      id
    }
  }
}

I receive this error:

{
  "errors": [
    {
      "message": "ERROR: relation \"users\" does not exist (SQLSTATE 42P01)",
      "path": [
        "users"
      ]
    }
  ],
  "data": null
}

It looks like it's still using the Query type name and not the actual TableName as defined in the schema using @tableName directive!

Any ides please?!

FastGQL first version roadmap

Hello, fastGQL users, this is a basic roadmap to complete before releasing first version of fastgql.

  • Support Full CRUD
    • select support
    • insert support #21
    • delete support #22
    • update support #34 #40
  • Support Aggregate functions (max, sum, min, count) - didn't support sum yet #29
  • Generation tests
  • SQL builder tests #17
  • Cursor Pagination support
  • Better docs (how to guides, adding custom scalars, custom operators, etc')
  • Define better relation directives
  • Code cleanup and documentation
    • Logging for schema generation
    • Cleanup schema package
    • Move packages into internal/pkg. #33
    • Support layout of schema based on original files #38
  • Multi Driver Support #40
    • Mongo
    • SQL

if you have any suggestions or feature requests, you can add to this thread or open feature request issues depending on complexity/importance will add it to the roadmap

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.