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

    schickling

    04/24/2017, 8:11 PM
    Hey there <!here|@here>! 👋 In case you’re using Relay and you’re thinking about migrating to Relay Modern, here is a step-by-step migration guide 📙 https://www.graph.cool/docs/tutorials/migrating-to-relay-modern-eijooto4se/
    👍 4
    graphcool 2
    😻 1
    ❤️ 1
    🚀 2
    graphql 3
  • n

    nickhudkins

    04/24/2017, 8:12 PM
    Oh @schickling you’re my hero.
  • n

    nickhudkins

    04/24/2017, 8:12 PM
    ❤️
  • s

    schickling

    04/24/2017, 8:12 PM
    Actually, @nikolasburk is 🙂
  • n

    nickhudkins

    04/24/2017, 8:12 PM
    lol ok fine.
  • m

    mewdriller

    04/24/2017, 9:13 PM
    Are there any examples floating around of subscriptions + authentication? I'm getting permissions errors on the subscriptions, but not queries which touch the same models.
    n
    • 2
    • 8
  • a

    artyom

    04/24/2017, 9:22 PM
    @volkangurol hello there, welcome to our slack! graphcool 🎉
  • p

    phil

    04/24/2017, 9:36 PM
    Is https://graph.cool/ down?
  • n

    nilan

    04/24/2017, 9:37 PM
    try https://www.graph.cool/ 🙂
  • n

    nilan

    04/24/2017, 9:38 PM
    https://graph.cool works again, was a small hiccup apparently
  • m

    mannigan

    04/24/2017, 9:52 PM
    i was just playing around with one to one relationships... is it really the case that creating a new object with the same relation to another object overwrites the existing relationship? i was expecting an error... am i doing something wrong or is that the intended behavior
    n
    • 2
    • 2
  • p

    phil

    04/24/2017, 9:54 PM
    Cool - thanks!
  • p

    phil

    04/24/2017, 9:54 PM
    Hey, is there a good way to have a default incrementing field on a Type? eg.
    count
    which just increments for every new item created in the table.
  • p

    phil

    04/24/2017, 9:55 PM
    Use-case: issue numbers.
  • n

    nilan

    04/24/2017, 9:55 PM
    Currently querying the count client-side + unique fields is a fair approach 🙂 we're looking into other ways to make this possible
  • p

    phil

    04/24/2017, 9:55 PM
    Thanks @nilan
  • n

    nilan

    04/24/2017, 9:56 PM
    @phil please susbcribe to this feature request:https://github.com/graphcool/feature-requests/issues/122 🙂
  • a

    artyom

    04/24/2017, 10:32 PM
    @paritosh hello! 👋
  • d

    dmiller

    04/25/2017, 2:21 AM
    Hi Folks, I'm using graph.cool and Apollo to learn graphql. I've written a mutation, bu when I run the mutation I get
    GraphQL error: Insufficient permissions for this mutation
    . The mutation looks like this:
    Copy code
    mutation createPick($name: String!, $url: String, $episodeId: ID, $userId: ID){
      createPick(name: $name, url: $url, episodeId: $episodeId, userId: $userId) {
        name,
        url
      }
    }
    I've executed similar mutations using code that looks basically the same no problem. Any thoughts? Happy to provide any other information, this is just a toy app basically.
  • d

    dmiller

    04/25/2017, 2:31 AM
    Does it have something to do with the fact that my picks have relations, to both episodes and users?
  • s

    sdubois

    04/25/2017, 4:53 AM
    Hey thanks @schickling! However I tried opening on safari iOS but the page keeps getting stuck a few seconds then scrolling back two thirds down the page.
    n
    n
    • 3
    • 2
  • a

    artyom

    04/25/2017, 9:13 AM
    🖖 @patrick-mcdougle @karuppiah7890 @alison.johnston be welcomed to graphcool on this day 🙂
  • n

    notrab

    04/25/2017, 9:31 AM
    Using the
    File
    schema, is it possible to upload a file using a remote URL? I’ve about 500 Types I want to important which all have a file associated on AWS currently but it would be good to important to graphcool
    n
    s
    • 3
    • 6
  • n

    notrab

    04/25/2017, 9:34 AM
    I’m following https://www.graph.cool/docs/tutorials/importing-simple-data-ga2ahnee2a/ but it would be good to upload a file within here from a remote URL.
  • l

    lucfranken

    04/25/2017, 11:49 AM
    Anyone got a hint on where to find the documentation for: “Store multiple values in this field” ? In most systems it’s a quite dangerous thing but maybe GraphCool implemented it in a cool way?
    n
    • 2
    • 35
  • a

    artyom

    04/25/2017, 12:05 PM
    @ilyago hello! great that you’re joining us in our slack 🎉 graphcool
  • k

    knowbody

    04/25/2017, 1:07 PM
    👋 hi all!
    🙌 1
    ✌️ 1
  • a

    artyom

    04/25/2017, 1:20 PM
    hey @knowbody and also @jonasspinner and @diego.bernardes come on, come all, and may you all be welcomed to our slack on this glorious day! graphcool 🌞
  • t

    theom

    04/25/2017, 2:12 PM
    So, I've setup a subscription, but it's not functioning as I expected it would. Basically, I expected, upon the creation or deletion of a record, changes made to be immediately reflected in different browsers pointed to my site. So I establish a a subscription as follows (apolloClient.js):
    Copy code
    import ApolloClient, {
      createNetworkInterface,
      addTypeName,
    } from 'apollo-client';
    
    import { 
        SubscriptionClient, 
        addGraphQLSubscriptions,
    } from 'subscriptions-transport-ws';
    
    import { 
      Subscription_Add_Delete_Comment_Query,
    } from './graphql/mutations-queries';
    
    // Create WebSocket client
    const wsClient = new SubscriptionClient('<wss://subscriptions.graph.cool/v1/projectID>', {
      reconnect: true,
      connectionParams: {
        // Pass any arguments you want for initialization
      }
    })
    const networkInterface = createNetworkInterface({ 
      uri: '<https://api.graph.cool/simple/v1/projectID>',
      opts: {
        // Additional fetch options like `credentials` or `headers`
        credentials: 'same-origin',
      }
    })
    
    // Extend the network interface with the WebSocket
    const networkInterfaceWithSubscriptions = addGraphQLSubscriptions(
      networkInterface,
      wsClient
    )
    
    const client = new ApolloClient({
      networkInterface: networkInterfaceWithSubscriptions,
      dataIdFromObject: (o) => o.id,
       addTypeName: true
    })
    
    // Create subscription
    let createDeleteSubscription = {
      query: Subscription_Add_Delete_Comment_Query,
      variables: {}
    };
    
    export let subscriptionObservable = client.subscribe(createDeleteSubscription);
    
    export default client;
    And then I do (App.js)
    Copy code
    import { subscriptionObservable } from '../apolloClient';
    
    const Comments = React.createClass({
      
      componentWillMount () {
        this.subscription = this.subscribe();
        console.log(`Subscribed for new messages with ID: ${this.subscription._networkSubscriptionId}`);
      },
      subscribe() {
        return subscriptionObservable.subscribe({
          error: (error) => {
            console.log(`Subscription error: ${error}`);
          },
          next: (data) => {
            console.log(`Subscription result: ${data.mutation}`);
          }
        });
      },
    render() {
        const comments = this.props.post.comments || [];
        return (
          <div className="comments">
    
            {_.map(comments, this.renderComment)}
    
            <form onSubmit={this.handleSubmit} ref="commentForm" className="comment-form">
              <input type="text" ref="author" placeholder="author"/>
              <input type="text" ref="comment" placeholder="comment"/>
              <input type="submit" hidden/>
            </form>
          </div>
        );
      }
    });
    
    Comments.propTypes = {
      client: React.PropTypes.instanceOf(ApolloClient).isRequired,
    }
    const CommentsWithApollo = withApollo(Comments);
    
    export default CommentsWithApollo;
    My subscription is as follows:
    Copy code
    export const Subscription_Add_Delete_Comment_Query = gql`
      subscription CreateDeleteComment {
        Comments (
          filter: {
            mutation_in: [CREATED, DELETED]
          }
        ) {
          mutation
          node {
            __typename
            id
            user
            text
            posts {
              id
            }
          }
          previousValues {
            __typename
            id
            user
            text
          }
        }
      }
    `;
    Now when I add a comment, say in firefox, console shows that the subscription has fired, but the change is only reflected in Chrome when I physically reload the page. What is the issue here?
    n
    • 2
    • 10
  • r

    rockchalkwushock

    04/25/2017, 2:32 PM
    have a quick question in regards to
    graphql-relay
    . The following:
    id: globalIdField('User'),
    is being used when the
    nodeDefinitions
    is being ran correct?
    Copy code
    const { nodeField, nodeInterface } = nodeDefinitions(
      (globalId) => {
        const { id, type } = fromGlobalId(globalId); // this globalId is stemming from the above...if that's what is provided at that point in time?
      }
    );
1...164165166...637Latest