https://www.prisma.io/ logo
Join Slack
Powered by
# prisma-whats-new
  • y

    yunjia

    03/19/2018, 10:13 PM
    All the solutions I found online are about adding cors from the backend, but how can I do that with Graphcool?
  • n

    nilan

    03/19/2018, 11:00 PM
    @moonmeister, which tutorial are you following?
    m
    • 2
    • 1
  • r

    Ryan Trainor

    03/19/2018, 11:14 PM
    Hi all, I'm trying to work through the HowToGraphQL "React-Apollo" Tutorial and keep hitting this error on the 2nd to last page. When I try to implement subscriptions
  • l

    Luke

    03/20/2018, 3:31 AM
    Hey
  • l

    Luke

    03/20/2018, 3:31 AM
    does anyone know how to create relationships in a
    seed.graphql
    file
  • l

    Luke

    03/20/2018, 3:32 AM
    like if I have a topic and 2 products
  • l

    Luke

    03/20/2018, 3:32 AM
    and I want to create the topic then assign it to both products in the seed file
  • l

    Luke

    03/20/2018, 3:32 AM
    or do I need to use a script instead of a seed file? In which case can anyone point me to an example?
  • b

    beb

    03/20/2018, 3:33 AM
    Typically you would use
    connect: { var : value }
  • l

    Luke

    03/20/2018, 3:34 AM
    in the seed file?
  • b

    beb

    03/20/2018, 3:34 AM
    so long as the db is seeded with what you're trying to connect, why not?
  • l

    Luke

    03/20/2018, 3:35 AM
    in my seed.graphql I ha ve
  • l

    Luke

    03/20/2018, 3:35 AM
    Copy code
    mutation {
      topic1: createTopic(data: {
        name: "Productivity"
        slug: "productivity"
      }) {
        id
      }
      product1: createProduct(data: {
        name: "Caramella"
        slug: "caramella"
        tagline: "A clean, modern blogging platform without the fuss"
        votes_count: 473
        comments_count: 28
      }) {
        id
      }
      product2: createProduct(data: {
        name: "Cover Letter Generator"
        slug: "cover-letter-generator"
        tagline: "Quickly generate cover letters with minimum details"
        votes_count: 313
        comments_count: 6
      }) {
        id
      }
    }
  • l

    Luke

    03/20/2018, 3:35 AM
    I want to assign
    topic
    when i create
    product1
    and
    product2
  • l

    Luke

    03/20/2018, 3:36 AM
    Copy code
    type Product {
      id: ID! @unique
      name: String!
      slug: String!
      tagline: String!
      votes_count: Int!
      comments_count: Int!
      topics: [Topic!]!
    }
  • b

    beb

    03/20/2018, 3:36 AM
    for multiple
  • l

    Luke

    03/20/2018, 3:37 AM
    ohhh
  • l

    Luke

    03/20/2018, 3:37 AM
    @beb I couldn’t find that in the docs 😞
  • b

    beb

    03/20/2018, 3:37 AM
    or for one: topics: { connect: { name : "Productivity" } }
  • b

    beb

    03/20/2018, 3:38 AM
    yes, because it's part of graphql more than it is specifically part of prisma.
  • l

    Luke

    03/20/2018, 3:38 AM
    ahh
  • l

    Luke

    03/20/2018, 3:38 AM
    I need to read the graphql spec more
  • l

    Luke

    03/20/2018, 3:38 AM
    then
  • b

    beb

    03/20/2018, 3:38 AM
    I had the same problem
  • l

    Luke

    03/20/2018, 3:38 AM
    do you have any links you found helpful?
  • b

    beb

    03/20/2018, 3:38 AM
    I started with prisma before actually looking at graphql as a language
  • b

    beb

    03/20/2018, 3:39 AM
    graphql docs are a 2-4 hours investment that is very worth your time if this is what you're stuck on
  • b

    beb

    03/20/2018, 3:39 AM
    http://graphql.org/learn/
  • l

    Luke

    03/20/2018, 3:40 AM
    Reason: 'topics.connect[0].name' Field 'name' is not defined in the input type 'TopicWhereUniqueInput'. (line 8, column 33):
  • l

    Luke

    03/20/2018, 3:40 AM
    I must have an issue with the syntax
1...614615616...637Latest