### Example GraphQL Query Structure Source: https://restagainsthumanity.com/api/graphql Illustrates the basic structure of a GraphQL query that can be executed within GraphiQL. ```graphql { field(arg: "value") { subField } } ``` -------------------------------- ### List All Pack Names Source: https://restagainsthumanity.com Use this query to retrieve the names of all available card packs. No specific setup is required beyond a GraphQL client. ```graphql query { packs { name } } ``` -------------------------------- ### GraphiQL Welcome Message Source: https://restagainsthumanity.com/api/graphql This is the default welcome message displayed in GraphiQL, explaining its purpose and basic usage. ```text # Welcome to GraphiQL 🍓 # GraphiQL is an in-browser tool for writing, validating, and # testing GraphQL queries. # Type queries into this side of the screen, and you will see intelligent # typeaheads aware of the current GraphQL type schema and live syntax and # validation errors highlighted within the text. # GraphQL queries typically start with a "{" character. Lines that starts # with a # are ignored. # An example GraphQL query might look like: # { # field(arg: "value") { # subField # } # } # Keyboard shortcuts: # Run Query: Ctrl-Enter (or press the play button above) # Auto Complete: Ctrl-Space (or just start typing) ``` -------------------------------- ### List All Packs and Cards Source: https://restagainsthumanity.com This query fetches all packs along with their black and white cards, including the text and pick count for black cards. This provides a comprehensive dataset of all cards within each pack. ```graphql query { packs { name black { text pick } white { text } } } ``` -------------------------------- ### List Packs by Name Query Source: https://restagainsthumanity.com This query retrieves packs that match a specific name, allowing filtering by keywords like 'expansion'. ```APIDOC ## packs by name ### Description List _Cards Against Humanity_ packs filtered by name. ### Query ```graphql query { packs(where: { name: "expansion" }) { name } } ``` ### Response Example ```json { "data": { "packs": [ { "name": "Expansion Pack 1" }, { "name": "Expansion Pack 2" } ] } } ``` ``` -------------------------------- ### List Packs and Cards Query Source: https://restagainsthumanity.com This query retrieves all packs along with their black and white cards. ```APIDOC ## packs with cards ### Description List all _Cards Against Humanity_ packs and their associated black and white cards. ### Query ```graphql query { packs { name black { text pick } white { text } } } ``` ### Response Example ```json { "data": { "packs": [ { "name": "Base Game", "black": [ { "text": "What's that smell?", "pick": 1 } ], "white": [ { "text": "A lonely sock." } ] } ] } } ``` ``` -------------------------------- ### List Packs Query Source: https://restagainsthumanity.com This query retrieves a list of all available Cards Against Humanity packs. ```APIDOC ## packs ### Description List _Cards Against Humanity_ packs. ### Query ```graphql query { packs { name } } ``` ### Response Example ```json { "data": { "packs": [ { "name": "Base Game" }, { "name": "Expansion Pack 1" } ] } } ``` ``` -------------------------------- ### List Black Cards by Pick Count Query Source: https://restagainsthumanity.com This query retrieves black cards from all packs, filtered by the number of blank spaces (`pick`). ```APIDOC ## black cards by pick ### Description List black cards from all _Cards Against Humanity_ packs, filtered by the `pick` argument. ### Query ```graphql query { packs { name black(where: { pick: 2 }) { text pick } } } ``` ### Response Example ```json { "data": { "packs": [ { "name": "Base Game", "black": [ { "text": "What is the air speed velocity of an unladen swallow?", "pick": 2 } ] } ] } } ``` ``` -------------------------------- ### List Black Cards with Pick of 2 Source: https://restagainsthumanity.com Filter and retrieve black cards that have a 'pick' value of 2. This is useful for finding cards that require a specific number of player-submitted answers. ```graphql query { packs { name black(where: { pick: 2 }) { text pick } } } ``` -------------------------------- ### List Packs Containing 'expansion' in Name Source: https://restagainsthumanity.com Retrieve packs whose names contain the word 'expansion'. This query uses a filter on the pack's name to narrow down the results. ```graphql query { packs(where: { name: "expansion" }) { name } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.