How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import { SubscriptionClient } from "subscriptions-transport-ws";
    import ApolloClient from "apollo-client";
    
    const GRAPHQL_ENDPOINT = "ws://localhost:3000/graphql";
    
    const client = new SubscriptionClient(GRAPHQL_ENDPOINT, {
      reconnect: true,
    });
    
    const apolloClient = new ApolloClient({
      networkInterface: client,
    });
    
    Docs
    0
  • import {
      SubscriptionClient,
      addGraphQLSubscriptions,
    } from "subscriptions-transport-ws";
    import ApolloClient, {
      createNetworkInterface,
    } from "apollo-client";
    
    // Create regular NetworkInterface by using apollo-client's API:
    const networkInterface = createNetworkInterface({
      uri: "http://localhost:3000", // Your GraphQL endpoint
    });
    
    // Create WebSocket client
    const wsClient = new SubscriptionClient(
      `ws://localhost:5000/`,
      {
        reconnect: true,
        connectionParams: {
          // Pass any arguments you want for initialization
        },
      }
    );
    
    // Extend the network interface with the WebSocket
    const networkInterfaceWithSubscriptions =
      addGraphQLSubscriptions(networkInterface, wsClient);
    
    // Finally, create your ApolloClient instance with the modified network interface
    const apolloClient = new ApolloClient({
      networkInterface: networkInterfaceWithSubscriptions,
    });
    
    Docs
    0
  • import {
      SubscriptionClient,
      addGraphQLSubscriptions,
    } from "subscriptions-transport-ws";
    import ApolloClient, {
      createNetworkInterface,
    } from "apollo-client";
    
    // Create regular NetworkInterface by using apollo-client's API:
    const networkInterface = createNetworkInterface({
      uri: "http://localhost:3000", // Your GraphQL endpoint
    });
    
    // Create WebSocket client
    const wsClient = new SubscriptionClient(
      `ws://localhost:5000/`,
      {
        reconnect: true,
        connectionParams: {
          // Pass any arguments you want for initialization
        },
      }
    );
    
    // Extend the network interface with the WebSocket
    const networkInterfaceWithSubscriptions =
      addGraphQLSubscriptions(networkInterface, wsClient);
    
    // Finally, create your ApolloClient instance with the modified network interface
    const apolloClient = new ApolloClient({
      networkInterface: networkInterfaceWithSubscriptions,
    });
    
    Docs
    0
  • // Extracts the function name out of an AWS Lambda Function ARN
    const arnComponents = stack.parseArn(arn, ":");
    const functionName = arnComponents.resourceName;
    
    Docs
    0
  • // Builds "arn::lambda:::function:MyFunction"
    stack.formatArn({
      service: "lambda",
      resource: "function",
      sep: ":",
      resourceName: "MyFunction",
    });
    
    Docs
    0
  • const rawBucket = new s3.CfnBucket(this, "Bucket", {
      /* ... */
    });
    // -or-
    const rawBucketAlt = myBucket.node
      .defaultChild as s3.CfnBucket;
    
    // then
    rawBucket.cfnOptions.condition = new CfnCondition(
      this,
      "EnableBucket",
      {
        /* ... */
      }
    );
    rawBucket.cfnOptions.metadata = {
      metadataKey: "MetadataValue",
    };
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples