apollo-boost#gql JavaScript Examples

The following examples show how to use apollo-boost#gql. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: remove.js    From tunnel-tool with MIT License 6 votes vote down vote up
mutation = gql`
  mutation DeviceOutletRemove($deviceid: String!, $outletid: String!) {
    viewer {
      devices {
        device(deviceid: $deviceid) {
          outlets {
            outlet(outletid: $outletid) {
              remove {
                ...DeviceFragment
              }
            }
          }
        }
      }
    }
  }
  ${DeviceFragment}
`
Example #2
Source File: Contributors.js    From spells-fyi with MIT License 6 votes vote down vote up
repository = () => {
    return gql`
    query {
        contributors_fyi @rest(type: "[Contributor]", path: "/repos/blocklytics/spells-fyi/contributors") {
            login
            avatar_url
          }

          contributors_subgraph @rest(type: "[Contributor]", path: "/repos/blocklytics/spells-subgraph/contributors") {
            login
            avatar_url
          }
      }
    `;
}
Example #3
Source File: update.js    From tunnel-tool with MIT License 6 votes vote down vote up
mutation = gql`
  mutation ServiceUpdate {
    viewer {
      service {
        update {
          id
          service {
            ...ServiceFragment
          }
        }
      }
    }
  }
  ${ServiceFragment}
`
Example #4
Source File: useTokenEntity.js    From feedadoc with MIT License 6 votes vote down vote up
GET_ENTITY_BY_TOKEN = gql`
  query getEntity($token: String!) {
    linkedToken(token: $token) {
      ... on FullProvider {
        id
        firstName
        lastName
        neighborhood
        city
        state
        country
        latitude
        address
        longitude
        facility
        email
        role
        description
        requests {
          type
          satisfied
        }
        active
      }
    }
  }
`
Example #5
Source File: update.js    From tunnel-tool with MIT License 6 votes vote down vote up
mutation = gql`
  mutation DeviceServiceUpdate($deviceid: String!) {
    viewer {
      devices {
        device(deviceid: $deviceid) {
          service {
            update {
              ...DeviceFragment
            }
          }
        }
      }
    }
  }
  ${DeviceFragment}
`
Example #6
Source File: ProviderPage.jsx    From feedadoc with MIT License 6 votes vote down vote up
GET_PROVIDER = gql`
  query Provider($id: ID!) {
    provider(id: $id) {
      id
      firstName
      city
      state
      neighborhood
      role
      facility
      description
      active
      createdAt
      requests {
        type
        satisfied
      }
    }
  }
`
Example #7
Source File: stop.js    From tunnel-tool with MIT License 6 votes vote down vote up
mutation = gql`
  mutation DeviceOutletStop($deviceid: String!, $outletid: String!) {
    viewer {
      devices {
        device(deviceid: $deviceid) {
          outlets {
            outlet(outletid: $outletid) {
              state {
                stop {
                  ...DeviceFragment
                }
              }
            }
          }
        }
      }
    }
  }
  ${DeviceFragment}
`
Example #8
Source File: VolunteerStepper.jsx    From feedadoc with MIT License 6 votes vote down vote up
GET_PROVIDER = gql`
  query Provider($id: ID!) {
    provider(id: $id) {
      id
      firstName
      requests {
        type
        satisfied
      }
    }
  }
`
Example #9
Source File: index.js    From tunnel-tool with MIT License 6 votes vote down vote up
DeviceFragment = gql`
  fragment DeviceFragment on Device {
    id
    deviceid
    service {
      upgradable
      needRestart
    }
    state {
      online
    }
    outlets {
      list {
        ...DeviceOutletFragment
      }
    }
    inlets {
      list {
        ...DeviceInletFragment
      }
    }
  }
  ${DeviceOutletFragment}
  ${DeviceInletFragment}
`
Example #10
Source File: Blog.js    From react-blog-github with MIT License 6 votes vote down vote up
GET_POSTS = gql`
{
  repository(owner: "${config.githubUserName}", name: "${config.githubRepo}") {
    issues(first: 100, states: OPEN, filterBy: { labels: "blog" }, orderBy: { direction: DESC, field: CREATED_AT }) {
      nodes {
        title
        body
        bodyHTML
        bodyText
        number
        labels(first: 100) {
          nodes {
            color
            name
            id
          }
        }
        author {
          url
          avatarUrl
          login
        }
        updatedAt
        id
      }
    }
  }
}
`
Example #11
Source File: start.js    From tunnel-tool with MIT License 6 votes vote down vote up
mutation = gql`
  mutation DeviceOutletStart($deviceid: String!, $inletid: String!) {
    viewer {
      devices {
        device(deviceid: $deviceid) {
          inlets {
            inlet(inletid: $inletid) {
              state {
                start {
                  ...DeviceFragment
                }
              }
            }
          }
        }
      }
    }
  }
  ${DeviceFragment}
`
Example #12
Source File: firstTimersOnlyIssue.js    From GSOD.Contributors_website with Mozilla Public License 2.0 6 votes vote down vote up
GET_LABELLED_ISSUES = gql`
query ($repo: String!){
  repository(owner: "moja-global", name: $repo) {
    issues(orderBy: {field: CREATED_AT, direction: DESC},first:100,states:OPEN, labels:["good first issue"]) {
      edges {
        node {
          title
          url
          createdAt
          number
          author{
            avatarUrl
            login
          }
          labels(first:5) {
            edges {
              node {
                name
                color
              }
            }
          }
        }
      }
    }
  }
}`
Example #13
Source File: remove.js    From tunnel-tool with MIT License 6 votes vote down vote up
mutation = gql`
  mutation DeviceOutletRemove($deviceid: String!, $inletid: String!) {
    viewer {
      devices {
        device (deviceid: $deviceid) {
          inlets {
            inlet(inletid: $inletid) {
              remove {
                ...DeviceFragment
              }
            }
          }
        }
      }
    }
  }
  ${DeviceFragment}
`
Example #14
Source File: locksByOwner.js    From locked.fyi with MIT License 6 votes vote down vote up
export default function locksByOwner() {
  return gql`
    query Locks($owner: String!) {
      locks(
        where: { owner: $owner }
        orderBy: creationBlock
        orderDirection: desc
      ) {
        address
        name
      }
    }
  `
}
Example #15
Source File: link.js    From tunnel-tool with MIT License 6 votes vote down vote up
mutation = gql`
  mutation DeviceInletCreate(
    $deviceid: String!
    $target: DeviceOutletTargetInput!
    $dest: EndpointInput!
  ) {
    viewer {
      devices {
        device(deviceid: $deviceid) {
          inlets {
            create(target: $target, dest: $dest) {
              ...DeviceFragment
            }
          }
        }
      }
    }
  }
  ${DeviceFragment}
`
Example #16
Source File: languages.js    From resumeker-fe with MIT License 6 votes vote down vote up
getLanguagesByDraft = gql `
query($draftID: ID!){
    getLanguagesByDraft(draftID: $draftID){
        id
        draftID
        language
    }
}
`
Example #17
Source File: App.js    From Gameplayer with MIT License 6 votes vote down vote up
GRAVATARS_QUERY = gql`
  query gravatars($where: Gravatar_filter!, $orderBy: Gravatar_orderBy!) {
    gravatars(first: 100, where: $where, orderBy: $orderBy, orderDirection: asc) {
      id
      owner
      displayName
      imageUrl
    }
  }
`
Example #18
Source File: index.js    From tunnel-tool with MIT License 6 votes vote down vote up
Get = gql`
  query Service {
    viewer {
      id
      service {
        ...ServiceFragment
      }
    }
  }
  ${ServiceFragment}
`
Example #19
Source File: education.js    From resumeker-fe with MIT License 6 votes vote down vote up
addEducationMutation = gql`
    mutation($input: EducationHistoryInput) {
        addEducationHistory(input: $input) {
            draftID
            schoolType
            schoolName
            startDate
            endDate
            certName
        }
    }
`
Example #20
Source File: index.js    From tunnel-tool with MIT License 6 votes vote down vote up
Get = gql`
  query Device($deviceid: String!) {
    viewer {
      id
      devices {
        device(deviceid: $deviceid) {
          ...DeviceFragment
        }
      }
    }
  }
  ${DeviceFragment}
`
Example #21
Source File: projects.js    From resumeker-fe with MIT License 6 votes vote down vote up
addProjectMutation = gql`
    mutation($input: ProjectInput!) {
        addProject(input: $input){
            draftID
            title
            projectUrl
            description
            startDate
            endDate
        }
    }
`
Example #22
Source File: index.js    From tunnel-tool with MIT License 6 votes vote down vote up
ServiceFragment = gql`
  fragment ServiceFragment on Service {
    upgradable
    needRestart
    messages {
      type
      message
    }
  }
`
Example #23
Source File: index.js    From monorepo-starter with MIT License 6 votes vote down vote up
getAuthorDetails = gql`
  query($name: String) {
    author(name: $name) {
      name
      books {
        title
      }
    }
  }
`
Example #24
Source File: index.js    From tunnel-tool with MIT License 6 votes vote down vote up
DeviceInletFragment = gql`
  fragment DeviceInletFragment on DeviceInlet {
    id
    inletid
    target {
      deviceid
      outletid
    }
    dest {
      host
      port
    }
    state {
      active
      status
      target {
        id
        state {
          active
        }
      }
      worker {
        ip
      }
      hosts {
        ip
      }
    }
  }
`
Example #25
Source File: createProvider.js    From feedadoc with MIT License 5 votes vote down vote up
CREATE_PROVIDER = gql`
  mutation CreateProvider(
    $firstName: String!
    $lastName: String
    $neighborhood: String
    $city: String!
    $state: String!
    $country: String!
    $email: String!
    $facility: String
    $role: String!
    $requests: [String!]!
    $description: String!
    $latitude: Float!
    $longitude: Float!
    $address: String!
  ) {
    createProvider(
      input: {
        firstName: $firstName
        lastName: $lastName
        neighborhood: $neighborhood
        city: $city
        state: $state
        country: $country
        email: $email
        facility: $facility
        role: $role
        requests: $requests
        description: $description
        latitude: $latitude
        longitude: $longitude
        address: $address
      }
    ) {
      errors
      editLink
      provider {
        id
      }
    }
  }
`
Example #26
Source File: viewer.js    From tunnel-tool with MIT License 5 votes vote down vote up
Get = gql`
  query {
    viewer {
      id
    }
  }
`
Example #27
Source File: Projects.js    From masterPortfolio with MIT License 5 votes vote down vote up
export default function Projects() {
  const [repo, setrepo] = useState([]);

  useEffect(() => {
    getRepoData();
  }, []);

  function getRepoData() {
    const client = new ApolloClient({
      uri: "https://api.github.com/graphql",
      request: (operation) => {
        operation.setContext({
          headers: {
            authorization: `Bearer ${atob(openSource.githubConvertedToken)}`,
          },
        });
      },
    });

    client
      .query({
        query: gql`
          {
            repositoryOwner(login: "${openSource.githubUserName}") {
              ... on User {
                pinnedRepositories(first: 6) {
                  edges {
                    node {
                      nameWithOwner
                      description
                      forkCount
                      stargazers {
                        totalCount
                      }
                      url
                      id
                      diskUsage
                      primaryLanguage {
                        name
                        color
                      }
                    }
                  }
                }
              }
            }
          }
        `,
      })
      .then((result) => {
        setrepoFunction(result.data.repositoryOwner.pinnedRepositories.edges);
        console.log(result);
      });
  }

  function setrepoFunction(array) {
    setrepo(array);
  }

  return (
    <div className="main" id="opensource">
      <h1 className="project-title">Open Source Projects</h1>
      <div className="repo-cards-div-main">
        {repo.map((v, i) => {
          return <GithubRepoCard repo={v} key={v.node.id} />;
        })}
      </div>
      <Button
        text={"More Projects"}
        className="project-button"
        href={greeting.githubProfile}
        newTab={true}
      />
    </div>
  );
}
Example #28
Source File: draft.js    From resumeker-fe with MIT License 5 votes vote down vote up
getDraftQuery = gql`
    query($id: ID!) {
        getDraft(id: $id) {
            id
            name
            email
            
            education{
                id
                schoolType
                schoolName
                startDate
                endDate
                certName
            }
            work{
                id
                startDate
                endDate
                title
                description
                company
            }
            project{
                id            
                title
                projectUrl
                description
                startDate
                endDate
            }
            skill{
                id
                name
                skillType
            }
            hobbies{
                id
                name
            }
        }
    }
`
Example #29
Source File: IngredientsList.jsx    From web-frontend with MIT License 5 votes vote down vote up
INGEDIENTS_LIST_QUERY = gql`
  {
    ingredients {
      _id
      name
    }
  }
`