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

    nilan

    01/28/2017, 4:19 AM
    definitely!
  • n

    nilan

    01/28/2017, 4:19 AM
    do you think automatically removing that field from Algolia index would be a good idea as well?
  • n

    nilan

    01/28/2017, 4:20 AM
    what about giving a warning when the user removes a field that is part of Algolia? should there be a warning?
  • m

    monkeybonkey

    01/28/2017, 4:23 AM
    either works - though automatically removing it might be more work
  • m

    monkeybonkey

    01/28/2017, 4:23 AM
    perhaps just running the algolia validation on schema change is good
  • m

    monkeybonkey

    01/28/2017, 4:24 AM
    so that the user can see the validation error when they save the schema changes
  • m

    monkeybonkey

    01/28/2017, 4:24 AM
    that might be simpler for you guys to implement
  • m

    monkeybonkey

    01/28/2017, 4:25 AM
    that way if you have other integrations that are dependent on the schema - all those validations can run at that point as well
  • p

    puppycodes

    01/28/2017, 4:28 AM
    hi ther
  • p

    puppycodes

    01/28/2017, 4:28 AM
    luv graph.cool
  • n

    nilan

    01/28/2017, 4:40 AM
    it's a good point
  • n

    nilan

    01/28/2017, 4:41 AM
    hey @puppycodes, awesome to hear that ๐ŸŽ‰
  • s

    schickling

    01/28/2017, 11:15 AM
    Hi there @ianp & @rapzo! ๐Ÿ™Œ
  • b

    brad.barnes

    01/28/2017, 12:01 PM
    Does anyone know if there is a way to simulate the Auth0 idTolken in the Graphcool playground? --Thanks
  • s

    schickling

    01/28/2017, 12:08 PM
    Hey @brad.barnes! Weโ€™ll release this feature over the next couple of days. (Maybe even today!)
  • b

    brad.barnes

    01/28/2017, 12:15 PM
    Perfect timing! Thanks!!!
    ๐Ÿ‘Œ 1
  • m

    martin

    01/28/2017, 10:39 PM
    Could anyone please lend a helping hand (or mind, that is)?
    Home.js
    Copy code
    import React from 'react'
    import { graphql } from 'react-apollo'
    import { userContactsQuery } from '../../graphql/queries'
    import { modifyUserContacts } from '../../graphql/mutations'
    class Home extends React.Component {
       (โ€ฆ)
    }
    export default graphql(modifyUserContacts)(
    	graphql(userContactsQuery, { options: { forceFetch: true } })(Home)
    )
    mutations.js
    Copy code
    import gql from 'graphql-tag'
    
    export const modifyUserContacts = gql`
    	mutation ($id: ID!, $firstName: String!, $lastName: String!, $birthDay: Int!, $birthMonth: Int!, $birthYear: Int!) {
    		updateUser(
    			id: $id,
    			firstName: $firstName,
    			lastName: $lastName,
    			birthDay: $birthDay,
    			birthMonth: $birthMonth,
    			birthYear: $birthYear) {
    				id
    				firstName
    				lastName
    				birthDay
    				birthMonth
    				birthYear
    			}
    		updateContacts(
    			id: $id
    			firstName: $firstName,
    			lastName: $lastName,
    			birthDay: $birthDay,
    			birthMonth: $birthMonth,
    			birthYear: $birthYear) {
    				id
    				firstName
    				lastName
    				birthDay
    				birthMonth
    				birthYear
    			}
    	}
    `
    The above code only produces
    this.props.user
    and
    this.props.allContacts
    as pulled from the
    queries.js
    file (not listed here). There are no
    this.props.updateUser
    or
    this.props.updateContacts
    , though. In other words,
    queries
    are working, but not the
    mutations
    .
  • m

    martin

    01/28/2017, 10:41 PM
    There is a
    this.props.updateQuery
    though, with error message:
    Copy code
    [Exception: TypeError: 'caller' and 'arguments' are restricted function properties and cannot be accessed in this context. at Function.remoteFunction (<anonymous>:3:14)]
  • t

    tobias

    01/29/2017, 8:31 AM
    Internal Server Error on File Model, shall contact you on Slack: Request ID: ciyielciq5c750131e4s037e1
  • s

    schickling

    01/29/2017, 11:25 AM
    Hey @tobias! Weโ€™re looking into it. Iโ€™ll reach out via DM!
  • t

    tonietto

    01/29/2017, 8:57 PM
    FYI: I've got the same error message as @tobias using Apollo, but I it was because I was not passing an non required argument (
    group
    , that has a default value), declared in the query:
    Copy code
    mutation createUser ($email: String!, $password: String!, $group: String) {
    createUser(authProvider: {email: {email: $email, password: $password}}, group: $group) {
        id
        email
        group
      }
    }
    In Apollo app:
    Copy code
    {
      "email": "<mailto:email@email.com|email@email.com>",
      "password": "123"
    }
    I've it fixed by not declaring it in the query:
    Copy code
    mutation createUserWithoutGroup ($email: String!, $password: String!) {
    createUser(authProvider: {email: {email: $email, password: $password}}) {
        id
        email
        group
      }
    }
    ๐Ÿ‘ 2
  • n

    nilan

    01/29/2017, 9:43 PM
    as far as I know, Apollo uses
    null
    for non-required, declared variables that you haven't defined in the
    variables
    options (or when calling the mutation)
  • n

    nilan

    01/29/2017, 9:43 PM
    therefore it never even comes to considering the default value
  • n

    nilan

    01/29/2017, 9:44 PM
    thanks for the heads up @tonietto
  • m

    martin

    01/29/2017, 10:36 PM
    Was able to find a solution: missed the
    { name: 'updateUser' }
    part.
    Copy code
    export default graphql(modifyUserContacts, { name: 'updateUser' })(
    	graphql(modifyUserContacts, { name: 'createContact' })(
    		graphql(modifyUserContacts, { name: 'updateContact' })(
    			graphql(modifyUserContacts, { name: 'deleteContact' })(
    				graphql(userContactsQuery, { options: { forceFetch: true } })(Home)
    			)
    		)
    	)
    )
    ๐Ÿ‘ 1
  • g

    georgelovegrove

    01/29/2017, 10:56 PM
    Hey all, already mentioned this over intercom but wandering if anyone else is looking for functions for pre-create/update mutations. An example if that doesn't make sense - a user submits to pay for a basket with a special coupon applied and before the order is put through it does some server validation such as ensuring the coupon is valid and that the basket meets the required threshold. Scaphold does it as pre and post custom logic
  • n

    nilan

    01/29/2017, 11:23 PM
    hey @georgelovegrove ๐Ÿ‘‹ thanks for the feedback! this definitely makes a lot of sense and we're already working on it! we're keeping track of this suggestion here: https://github.com/graphcool/feature-requests/issues/23
  • g

    georgelovegrove

    01/29/2017, 11:26 PM
    @nilan great stuff, would really complete the offering for me with that functionality in ๐Ÿป
  • a

    ambethia

    01/30/2017, 6:48 AM
    ๐Ÿ‘‹
  • n

    nilan

    01/30/2017, 7:18 AM
    hi there @ambethia simple smile
1...919293...637Latest