Giter Site home page Giter Site logo

prisma / prisma1 Goto Github PK

View Code? Open in Web Editor NEW
16.6K 94.0 868.0 189.37 MB

πŸ’Ύ Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]

Home Page: https://v1.prisma.io/docs/

License: Apache License 2.0

Shell 0.44% JavaScript 0.16% TypeScript 30.74% HTML 0.15% Makefile 0.03% Scala 68.32% Java 0.18% EJS 0.01%
orm database graphql datamapper serverless dao prisma1

prisma1's Issues

Algolia integration

Support location field type in Model. This is an important feature for integration with Algolia.

ex:
_geoloc: {
lat: 40.639751,
lng: -73.778925
}

It must be also possible to have a list of locations. Use case where one wants to record the last 3 locations the user visited in database.

ex:
_geoloc: [
{ "lat": 47.279430, "lng": 5.106450 },
{ "lat": 47.293228, "lng": 5.004570 },
{ "lat": 47.316669, "lng": 5.016670 }
]

Configure plural names of models

In some cases it might be needed to provide a custom plural name of a model.

Here is how it could be configured in the datamodel:

type Person @plural(name: "People") {
  name: String!
}

Nested Delete Mutations

Extend nested mutation feature to include delete mutations. Helpful when you have dependent children and want to delete them given the deletion of the parent. Might look like:

mutation deleteCategory($id: ID!) {
    deleteCategory(id: $id, subCategories: ALL) {
        id
    }
}

Support list types in nested mutations

Would be great if something like the following would work:

mutation {
  createItem(
    title: "Hello world"
    subitems: [{
      title: "sub item 1"
    }, {
      title: "sub item 2"
    }]
}

Allow actions on relations

When creating an action, the dashboard description says you can pick a model/relation. However, the dashboard does not have relations in the dropdown, only models.

Please add relations to action triggers as that seems like a very common scenario. For instance if I had a post model and say I created a many to many relationship with users, calling it "sharedWith", where I send an email to anyone I share the post with.

Maintenance mode

It could be useful to disable HTTP access to a project similar to Heroku, for example:

  • to do some bigger backend refactoring
  • if an issue comes up (endpoint compromised, permission rules mixed up etc)
  • simply to put a project "in the fridge" for a while

Search into related nodes

Add ability to filter on related nodes. For example, getting only Users which have associated Tracks:

{
  viewer {
    allUsers(filter: ???) {
      edges {
        node {
          slug
          tracks {
            edges {
              node {
                title
              }
            }
          }
        }
      }
    }
  }
}

Without filter, this could return:

{
  "data": {
    "viewer": {
      "allUsers": {
        "edges": [
          {
            "node": {
              "slug": "user-without-tracks",
              "tracks": {
                "edges": []
              }
            }
          },
          {
            "node": {
              "slug": "user-with-tracks",
              "tracks": {
                "edges": [
                  {
                    "node": {
                      "title": "Some Awesome Track"
                    }
                  }
                ]
              }
            }
          }
        ]
      }
    }
  }
}

user-without-tracks shouldn't be returned.

Maybe this relates to https://github.com/graphcool/feature-requests/issues/2.

Server-side rendering (SSR)

React apps can use libraries such as isomorphic-relay to get server-side rendering for the initial page render. However such libraries require running on a dedicated GraphQL server, but there is no such server when using graph.cool as a backend. It would thus be great for graph.cool to provide these HTML and JS pre-rendering endpoints.

Clone projects

When working with projects you sometimes want to have multiple staged environments. The easiest way to get there, for now, is to clone an existing project.

When cloning a project you can choose one of the following options:

  • Clone just the structure (models, fields, permissions)
  • Clone structure including data
  • Clone everything (including actions and files)

Allow integration with Auth0 rules and createUser

To make auth0 user integration simpler, allow an insert into createUser by auth0 userId rather than an auth0 token. This could be restricted to admin roles.

Auth0 has a server side rule trigger than can post user data and userId to an http endpoint on user registration. Unfortunately, it doesn't have a userId token that it can pass along to the graphcool endpoint.

This would make auth0 integration pretty simple.

Multi-user projects / Collaboration

  1. IMHO projects should not be tied to one person but be accessible by different team members.
  2. It would be awesome to allow external partners to edit project data by sharing the data browser with them (using the configured permission levels). During prototyping, it is wasteful to add in the front-end editing features which do not target the end-user directly. Such a dashboard could then act as a CMS.

update/delete by

Use case:
My user model has two unique keys. a) GraphQLID b) FacebookId. Would be great to update the User Model directly via the FacebookId without the need to first query the GraphQLID.
Example:

 updateUser(idFb:"12233232", state: MAIN)
{
    state
  }

Simple server side validation

Can we have some simple additional constraints like length for String attributes, or checking that a String is an email or that an Int is not negative?

Network Tab

A panel that displays incoming requests and responses to the project and aggregates all errors for easy viewing. Maybe this could be part of a graphcool CLI?

Clone types

This feature request comes from my experience on graphcool as user and it's something that i needed that i think could be useful for everyone, under certain circumstances.

Situation:

the user had to setup multiple models, some of them has a lot of fields and they are similar to each other.

Issue:

the user has to create every field of every model manually, consuming a lot of time on models with fields that he/she has already created

Request:

a possible solution would be placing a 'duplicate' or 'copy' button on the console interface, on the model name row, or inside the model page that creates a new model called, for example, _1, that already contains every field existing on the origin model.
If for some reason a field or a relation cannot be duplicated the user should have a warning on screen.

Discussion: Cascading Deletes

It should be possible to configure cascading deletes on relations.

If a user has many posts, it should be possible to specify that if a a user is deleted all associated posts should also be deleted.

We need to consider what should happen if a user is not delete, but all posts are removed from the relation. In traditional relational databases this scenario is not relevant as you can only have cascading deletes in association with foreign key constraints.

Related to but not a duplicate of #42

Project ID alias

Tiny feature but it would be neat to set a project ID alias for use in the API endpoint URL

Usage statistics

Due to our rate limiting, it's fairly important to have usage statistics.
As pointed out by @Brene the url could be https://dashboard.graph.cool/{project}/account/usage

Email Auth Provider - validate email and reset password email

The Email Auth Provider should support:

  • When a user signs up, send a validation email
  • When a user want to change their email, send a validation email
  • When a user want to change their password, verify that the old password is correct
  • When a user forgot their password, send a password reset email
  • Refresh tokens

Support using Input Types for Mutation arguments

Currently when you do a mutation, you just have createPost(field1, field2, ... , fieldN), which means it's quite difficult to use variables on complex mutations.

A better route would be to allow a input type, for instance: createPost(post: Post) β€” in this case just using the Post type.

A further extension on this would be to allow using "Input Types", which are effectively subsets of the entity's Type, for instance: createPost(post: CreatePostInput)

Where Post is defined as:

type Post {
    id: ID!
    createdAt: DateTime
    updatedAt: DateTime
    title: String!
    body: String!
    poster: User!
}

And CreatePostInput is defined as:

type CreatePostInput {
    title: String!
    body: String!
}

By allowing these "Input Types", we can effectively achieve finer grain creation. It also prevents code like the following (taken from graphql-training/graphql-training.github.io)

// You can also use `graphql` for GraphQL mutations
export default graphql(gql`
  mutation createTrainingRequest(
      $name: String!
      $email: String!
      $companyName: String
      $attendees: Int!
      $modules: [TRAINING_REQUEST_MODULES!]!
      $additionalDetails: String
      $city: String!
      $country: String!
      $diversityRequested: Boolean!
      $onsiteRequested: Boolean!
) {
    createTrainingRequest(
        name: $name
        email: $email
        companyName: $companyName
        attendees: $attendees
        modules: $modules
        additionalDetails: $additionalDetails
        city: $city
        country: $country
        diversityRequested: $diversityRequested
        onsiteRequested: $onsiteRequested
    ) {
      id
    }
  }
`)(RequestForm);

Instead, I could've just done:

// You can also use `graphql` for GraphQL mutations
export default graphql(gql`
  mutation createTrainingRequest(
      $trainingRequest: CreateTrainingRequestInput!
) {
    createTrainingRequest(trainingRequest: $trainingRequest) {
      id
    }
  }
`)(RequestForm);

More Constraints

Make field constraints much more flexible.
This feature can probably be delivered in smaller chunks

Use case 1

A phone number field should match a regex

Use case 2

A phone number field should be required if and only if the roles field is STORE_MANAGER

Use case 3

A money field should only allow prime numbers

"Required" constraint for a relation

Example - A post object is required to have an author.

In this case a Post's relation to the user via the Author field should be required.

The required constraint functionality exists currently for fields but not for relations.

Unicity across different models

I want to create two models, User and Org which both have a slug, ensuring that this slug is unique across all users and orgs (similar to GitHub and such sites). I don't think graph.cool currently allows this?

Upsert Mutations

Currently each model gets an update and a create mutation. Performing an update or create if needed requires an additional query to be performed before the mutation.

A possible solution could be an upsertModel mutation that would try and query the model by one of the passed fields instead of a passed ID (still need to come up with a smart way of defining which field should be used for the lookup) and updates the row. If no model object matches the query a new one will be created with the passed parameters.

For the upsert mutation the parameter signatures would be similar as for the create mutation. All fields that are required for create need to be required for upsert (contrary to update where every field besides the id is optional).

Allow Auth0 Users to have multiple signins / auth0ids after they merge their auth0 accounts

Example: If a user creates an account through Auth0 username/password (auth|etc...) and then later returns to the site and attempts to login with facebook, a new account will be created (facebook|etc...). If the Auth0 Admin has created a rule that automerges accounts, the original username/password account will get merged on the auth0 database with the facebook one under the facebook auth0id. If the user then attempts to login to their graph.cool app with the original Auth0 username/password credentials, they'll find that they are now in their second duplicate facebook account and that their original account is unreachable (two accounts exist on the graph.cool db––one for the facebook|... and one for the auth|... but only one account exists on the auth0 database with both identities merged under a single id).

Multiple Relations with Same Relationship

Allow multiple relations with the same relationship. Would have to have user named field names instead of defaulting to the model name. Example: Say we have two models, Category and SubCategory. Want to be able to create two relations in Category, both to SubCategory. Might name the relations "SubCategoryGroup1" and "SubCategoryGroup2", and have the reciprocal names on the SubCategory model be "CategoryGroup1" and "CategoryGroup2".

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.