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

    nilan

    07/19/2017, 7:34 PM
    Nice
    Erlang
    snippet, @leandros šŸ˜„
  • n

    nilan

    07/19/2017, 7:36 PM
    Might need to take a look tomorrow though. Could you tell me what the operation it is you do?
  • u

    user

    07/19/2017, 7:36 PM
    @leandros commented on @leandros’s file https://prisma.slack.com/files/U66PKTXGF/F6BSMN90E/permission_fail.erl: When I use this READ permission it fails when I do allStudents query but it works fine when I do query Student(id: ...) Is this normal ?
    Permission_fail.erl
  • n

    nilan

    07/19/2017, 7:38 PM
    @leandros your permission query says this: only allow to query student with id
    cj5bdfoip1luc0111w9n5fpe4
    šŸ‘ 1
  • b

    bequis

    07/19/2017, 7:38 PM
    Hey again! I'm near, I can feel it šŸ˜„ After sucessfully loading requests from Python to Graphcool now I need help regarding Apollo on RN: I have this query code to get allMatches from my type Match:
    Copy code
    const FeedWithData = graphql(
    	gql`
    		query allMatches {
    			match {
    				homeTeam
    				score
    				awayTeam	
    			}
    		}
    	`,
    	{
    		options: {
    			notifyOnNetworkStatusChange: true,
    		},
    	}
    )(Matches);
    But it gives me this error:
    Error: GraphQL error: Cannot query field 'match' on type 'Query'. (...)
  • b

    bequis

    07/19/2017, 7:39 PM
    The type I want to query is Match... and gather all matches, with the fields homeTeam, score and awayTeam...
  • b

    bequis

    07/19/2017, 7:42 PM
    changed it to:
    Copy code
    const FeedWithData = graphql(
    	gql`
    		query {
    			allMatches {
    				homeTeam
    				score
    				awayTeam	
    			}
    		}
    	`,
    	{
    		options: {
    			notifyOnNetworkStatusChange: true,
    		},
    	}
    )(Matches);
  • b

    bequis

    07/19/2017, 7:42 PM
    I think it will work now...
  • u

    user

    07/19/2017, 8:00 PM
    @agartha commented on @leandros’s file https://prisma.slack.com/files/U66PKTXGF/F6BSMN90E/permission_fail.erl: @leandros When you use the simple API, if you don't have permissions for some nodes in the resultset, the entire set becomes
    null
    , when using the Relay API, you'll get back all Students, all will be null, except the one with the ID you specified in the permission query. You can use the Playground to compare the two results.
    Permission_fail.erl
  • b

    bequis

    07/19/2017, 8:03 PM
    Does anyone here has experience with graphQL and Apollo on Expo? I'm getting a nasty experience which is freezing my app when I wrap ApolloProvider on any screen... plus the data is never presented or even fetch from my Graphcool API... Here's my code:
    Copy code
    const FeedWithData = graphql(
    	gql`
    		query {
    			allMatches {
    				homeTeam
    				score
    				awayTeam	
    			}
    		}
    	`,
    	{
    		options: {
    			notifyOnNetworkStatusChange: true,
    		},
    	}
    )(Matches);
    
    function MatchList({ data }) {
    	if (data.networkStatus === 1) {
    	  return <ActivityIndicator style={styles.loading} />;
    	}
    
    	if (data.error) {
    		return <Text>Error: {data.error.message}</Text>
    	}
    
    	return (
    		<FlatList
    			data={data}
    			refreshing={data.networkStatus === 4}
    			onRefresh={() => data.refetch()}
    			renderItem={({ item }) => {
    				return (
    					<Text> {item.homeTeam} vs {item.awayTeam} </Text>
    				);
    			}}
    		/>
    	)
    }
  • u

    user

    07/19/2017, 8:08 PM
    @leandros commented on @leandros’s file https://prisma.slack.com/files/U66PKTXGF/F6BSMN90E/permission_fail.erl: @agartha Thank you very much !
    Permission_fail.erl
  • c

    claym

    07/19/2017, 9:17 PM
    just wanted to say thanks to everybody who helped me in here, especially @nilan, i've got my site up and running off graph.cool: https://www.sportsdespair.com
    🦜 2
    n
    • 2
    • 2
  • c

    claym

    07/19/2017, 9:18 PM
    now, to figure out how to integrate auth0 along with everything else šŸ‘
  • a

    andyblack

    07/19/2017, 9:21 PM
    Hey, I'm using React/Apollo and am struggling to catch my insufficient permission errors. I've got an error-handler on the ApolloClient network interface (which is console.error-ing 3 errors as desired), but I'm still getting 3 more 'unhandled' errors which I'm pretty sure are duplicates. Am I meant to catch them on the component as well? Like as part of
    export default graphql(getUsers)(Home);
    somehow? I found http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error which helpfully says "If you do not handle this error you will get a warning in your console that says something like: "Unhandled (in react-apollo) Error: ..." without actually saying how to handle it...
    d
    • 2
    • 7
  • b

    bequis

    07/19/2017, 10:44 PM
    Quick question: How do I get all Data from a specific field? I have this schema:
    Copy code
    type Match {
        datePlayed: String!
    }
    How do I get all Matches of the same date?
  • m

    mikael

    07/19/2017, 11:00 PM
    @bequis example from howtographql
    Copy code
    //
    // We want to be able to filter users by age
    // The argument is given a default value that allows all users to be returned
    //
    type Query {
      allUsers(olderThan: Int = -1): [User!]!
    }
    //
    // We can then filter our request by passing in a parameter in our query
    //
    {
      allUsers(olderThan: 30) {
        name
        age
      }
    }
  • m

    mikael

    07/19/2017, 11:01 PM
    something similar to that
  • b

    brennen

    07/19/2017, 11:07 PM
    I am going through the graphql-js tutorial on https://howtographql and have run into an issue. On this page: https://www.howtographql.com/graphql-js/4-connectors/, it says I need to put
    Copy code
    const connectMongo = require('./mongo-connector');
    
    // 2
    const start = async () => {
      // 3
      const mongo = await connectMongo();
      var app = express();
      app.use('/graphql', bodyParser.json(), graphqlExpress({
        context: {mongo}, // 4
        schema
      }));
      app.use('/graphiql', graphiqlExpress({
        endpointURL: '/graphql',
      }));
    
      const PORT = 3000;
      app.listen(PORT, () => {
        console.log(`Hackernews GraphQL server running on port ${PORT}.`)
      });
    };
    
    // 5
    start();
    in my index.js file. I do that and then I try and run the code and I get the following error:
    Copy code
    SyntaxError: Unexpected token (
    Anyone have any idea what is going on?
  • j

    jasonmerino

    07/19/2017, 11:09 PM
    @brennen Does your error have any file and line number in it?
  • j

    jasonmerino

    07/19/2017, 11:09 PM
    The code you pasted looks good.
  • b

    brennen

    07/19/2017, 11:10 PM
    @jasonmerino It says it is happening on this line
    Copy code
    const start = async () => {
  • b

    brennen

    07/19/2017, 11:10 PM
    My thought is that it doesn't like the fat arrow notation
  • j

    jasonmerino

    07/19/2017, 11:12 PM
    Yeah, looks like it. What version of Node are you running? I assume this is on a node server?
  • b

    brennen

    07/19/2017, 11:13 PM
    6.3.1
  • b

    brennen

    07/19/2017, 11:13 PM
    Yes, running on node
  • j

    jasonmerino

    07/19/2017, 11:15 PM
    Okay, that version of node handles arrow functions.
  • j

    jasonmerino

    07/19/2017, 11:16 PM
    Can you paste in more from the error message?
  • n

    nilan

    07/19/2017, 11:16 PM
    it's about the async, @brennen
  • j

    jasonmerino

    07/19/2017, 11:17 PM
    Ahhhh, yes. http://node.green/#ES2017-features-async-functions
  • n

    nilan

    07/19/2017, 11:17 PM
    previously to some recent version you need to use a harmony flag to be able to use async, and I'm not sure if your node version offers that already
1...278279280...637Latest