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

    ambethia

    02/01/2017, 6:38 PM
    I'll just do the full reload for now in that case.
  • a

    ambethia

    02/01/2017, 6:39 PM
    That pokemon tutorial implies that this mutation should cause the refresh:
    Copy code
    mutation ($name: String!, $ownerId: ID) {
        createFamily(name: $name, ownerId: $ownerId) {
          owner {
            id
            ownedFamilies {
              id
            }
          }
        }
      }
    but it doesn't seem to do it. Bummer, I'll just try the first think you suggested
  • n

    nilan

    02/01/2017, 6:39 PM
    well that also depends on how you query
  • n

    nilan

    02/01/2017, 6:39 PM
    in the pokemon tutorial we query the Trainer
  • n

    nilan

    02/01/2017, 6:39 PM
    in your case that would be a query for the user
  • a

    ambethia

    02/01/2017, 6:39 PM
    just a few, usually only one, for this app
  • n

    nilan

    02/01/2017, 6:40 PM
    yea, checking your
    FamilyQuery
    above, this should work... hm
  • a

    ambethia

    02/01/2017, 6:40 PM
    oh, it because my first query was for
    user { id }
  • a

    ambethia

    02/01/2017, 6:40 PM
    does it not know
    user
    ==
    owner
    ?
  • n

    nilan

    02/01/2017, 6:40 PM
    yes it does because of the same id
  • a

    ambethia

    02/01/2017, 6:40 PM
    Right
  • n

    nilan

    02/01/2017, 6:41 PM
    is the
    FamilyQuery
    the same query that should be updated after the mutation?
  • n

    nilan

    02/01/2017, 6:41 PM
    or is there another query involving families
  • a

    ambethia

    02/01/2017, 6:43 PM
    If I take out the
    (orderBy: name_ASC)
    from
    FamilyQuery
    it blows up
  • a

    ambethia

    02/01/2017, 6:43 PM
    then I add
    name
    to the mutation:
    ownedFamilies { id name }
    and it works!
  • n

    nilan

    02/01/2017, 6:43 PM
    😄
  • n

    nilan

    02/01/2017, 6:43 PM
    this is weird
  • a

    ambethia

    02/01/2017, 6:44 PM
    yeah
  • n

    nilan

    02/01/2017, 6:44 PM
    https://dev-blog.apollodata.com/apollo-client-developer-tools-ff89181ebcf
  • n

    nilan

    02/01/2017, 6:44 PM
    did you already install the apollo dev tools?
  • n

    nilan

    02/01/2017, 6:44 PM
    give great insight in what's happening
  • a

    ambethia

    02/01/2017, 6:44 PM
    ooooh no I didn't know that was a thing!
  • n

    nilan

    02/01/2017, 6:44 PM
    but yeah, seems to be some weird interaction
  • a

    ambethia

    02/01/2017, 6:44 PM
    Installed
  • n

    nilan

    02/01/2017, 6:45 PM
    I actually didn't see the
    orderBy
    argument in your query before, this complicates things
  • a

    ambethia

    02/01/2017, 6:45 PM
    Let me see if sorting in the mutation lets it keep working
  • n

    nilan

    02/01/2017, 6:45 PM
    also, it's good practice to name your queries, like that:
  • a

    ambethia

    02/01/2017, 6:45 PM
    yup!
  • n

    nilan

    02/01/2017, 6:45 PM
    Copy code
    const FamiliesQuery = gql`query FamiliesQuery {
      user {
        id
        ownedFamilies(orderBy: name_ASC) {
          id
          name
        }
      }
    }`
  • a

    ambethia

    02/01/2017, 6:46 PM
    ah ok, I wasn't sure
1...959697...637Latest