https://www.prisma.io/ logo
Join Slack
Powered by
# orm-help
  • c

    cing

    01/03/2019, 7:33 PM
    Hi, I keep on getting the error "Error: Field <fieldName> : Couldn't find type <type here> in any of the schemas". I've deleted the fields and types in question, and ran a "prisma reset" and I keep on getting the same error. my suspicion is that prisma is not reading from an updated file and i need to clear a cache or something. what do i do next?
  • c

    CCBCodeMonkey

    01/03/2019, 8:21 PM
    I have a question, I have two types in my datamodel schema... for example one is
    Post
    and one is
    UserData
    ... they are both just types in my datamodel schema with properties... but Post gets these functions made for it by prisma:
    createManyPosts
    , but also
    createPost
    , where as
    UserData
    only gets
    createManyUserDatas
    and not the singular
    createUserData
    .... why is this?? really confused
  • c

    CCBCodeMonkey

    01/03/2019, 8:24 PM
    I figured out why... apparently its if you don't put
    id: ID! @unique
    on the type.. I thought id was implicit though...
  • k

    KyleG

    01/03/2019, 8:36 PM
    I know this isn't a place for self-promotion, but I felt like some of you would get a kick out of the website I built solo (my first, with great pride) in the last eight months using Prisma from day one: http://metric-teacher.com/demo It's still in many many ways a work-in-progress, but considering I switched the
    PRISMA_ENDPOINT
    from
    dev
    to
    prod
    I figure it's worth sharing.
    ❤️ 1
    🦜 4
    t
    • 2
    • 2
  • m

    mrszympek

    01/03/2019, 8:44 PM
    Hi 🙂 My cli stucked at ? Set up a new Prisma server or deploy to an existing server? Demo server. Some ideas how to fix that ?
    k
    • 2
    • 1
  • n

    Nick

    01/03/2019, 10:02 PM
    Personal question I think something like prisma would be great if sat on top rails/django/laravel version of JavaScript. Creators of prisma will you guys ever make a full fledge web framework of prisma or collaborate with existing one?
  • m

    mahkali

    01/03/2019, 10:40 PM
    Hi, question. I'm following the docs on creating a Prisma server on Go, using mongoDb. I running into this issue:
    Copy code
    server/resolver.go:68:4: unknown field 'Author' in struct literal of type "hello-world/generated/prisma-client".PostWhereInput
  • m

    mahkali

    01/03/2019, 10:43 PM
    what could be the issue here?
  • x

    xiaoqf10

    01/04/2019, 1:57 AM
    Does prisma support user defined transaction?
    s
    • 2
    • 4
  • j

    Joe

    01/04/2019, 3:05 PM
    hey guys, we are running into issue with concurrent tasks that the prisma can execute. is there a way of increasing that limit? here is an example of an error we are seeing: "exception":"java.util.concurrent.RejectedExecutionException: Task slick.basic.BasicBackend$DatabaseDef$$anon$2@37bfcdbe rejected from slick.util.AsyncExecutor$$anon$2$$anon$1@7d867e90[Running, pool size = 9, active threads = 8, queued tasks = 1000, completed tasks = 3001277]"
  • s

    szaudowsky

    01/04/2019, 5:04 PM
    Hello Guys, I have a question.. I need to create some kind of relation between 3 tables (or types) - User, Team and Role. The case is -> User could create the team, if team is created user get role “capitan”, user, could create multiple teams. Also user could be added to another team, by other User (capitan) in these case, user gonna have role “player”. So, user can be part of multiple teams, with only one role in single one: “UserA, TeamA, “Capitan”, “UserA, TeamB, “Player”, I just tried to find answer in google, but i can not find any solution for this case. Is this possible to create relation like this in Prisma?
    k
    a
    l
    • 4
    • 9
  • s

    szaudowsky

    01/04/2019, 5:11 PM
    Thanks a lot for help
  • i

    Industrial

    01/04/2019, 7:38 PM
    Hello.
  • i

    Industrial

    01/04/2019, 7:39 PM
    I have some cursomt PostgreSQL for fetching and saving a specific model called OHLCV. (Open, High, Low, Close, Volume, it's financial chart data)
  • i

    Industrial

    01/04/2019, 7:40 PM
    Because I'm saving them in different tables based on some variables
  • i

    Industrial

    01/04/2019, 7:42 PM
    The primary keys of the tables should be named "timestamp" with an ISO Datetime (msec)
  • t

    Tiago Correia

    01/04/2019, 7:56 PM
    Copy code
    type Notification {
      id: ID! @unique
      sender: User! 
      receiver: User!
      relatesTo: ID
      type: NotificationTypes!
      content: String!
      isRead: Boolean!
      createdAt: DateTime!
    }
  • t

    Tiago Correia

    01/04/2019, 7:56 PM
    how would you guys implement this @relation since there's two fields that related directly to the user
  • i

    Industrial

    01/04/2019, 7:57 PM
    the
    receiver: User
    is the relation.
  • t

    Tiago Correia

    01/04/2019, 7:57 PM
    what about keep track of the notifications submited by X user, would you have 2 type of relations?
  • m

    mahkali

    01/04/2019, 8:03 PM
    Hi all: question, I'm trying the exists function in Go as mentioned here: https://www.prisma.io/docs/prisma-client/features/check-existence-GO-go01/ I'm relatively new to Go and Prisma, how would i call this in the following situation:
    Copy code
    func (r *mutationResolver) CreateDraft(ctx context.Context, title string, userId string) (*<http://prisma.Post|prisma.Post>, error) {
    	userExists := r.Prisma.Client.Exists.User(&prisma.UserWhereUniqueInput{
    		ID: userId,
    	})
    
    	if(userExists == nil) {
    		panic("User not found");
    	}
    
    	return r.Prisma.CreatePost(prisma.PostCreateInput{
    		Title: title,
    		Author: &prisma.UserCreateOneWithoutPostsInput{
    			Connect: &prisma.UserWhereUniqueInput{ID: &userId},
    		},
    	}).Exec(ctx)
    }
  • m

    mahkali

    01/04/2019, 8:04 PM
    r.Prisma.client does not seem to work
  • m

    mahkali

    01/04/2019, 8:15 PM
    otherwise how would i do it?
  • i

    Industrial

    01/04/2019, 8:26 PM
    Hi. How do I get all values of an
    Enum
    ?
  • i

    Industrial

    01/04/2019, 8:43 PM
    got it.
  • i

    Industrial

    01/04/2019, 8:44 PM
    Copy code
    query {
          __type(name: "MyType") {
            enumValues {
              name
            }
          }
        }
  • i

    Industrial

    01/04/2019, 9:22 PM
    Question: When I use Prisma, can I use custom Resolver code?
  • i

    Industrial

    01/04/2019, 9:22 PM
    I don't have Graphcool, just Prisma and a datamodel.graphql
  • i

    Industrial

    01/04/2019, 9:23 PM
    But I want to override the
    datamodel.graphql
    default implementation of some queries. I have custom SQL query code that I need to execute.
  • i

    Industrial

    01/04/2019, 9:28 PM
    found it, https://www.prisma.io/tutorials/build-a-graphql-server-with-prisma-ct02
1...183184185...637Latest