Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

How to use versions feature? #122

Open
heitorlessa opened this issue Jun 7, 2020 · 0 comments
Open

How to use versions feature? #122

heitorlessa opened this issue Jun 7, 2020 · 0 comments

Comments

@heitorlessa
Copy link

Hello,

I've been trying to use versions feature to have docs available for the latest version from master branch, and latest docs for develop of unreleased features.

I'm getting the following error when I attempt to follow the docs: Unknown argument "gitRemote" on field "file" of type "Query"

...
versions: {
    'master': 'master',
    'develop': 'develop'
},
...

Is that how the feature is supposed to be used?


Full logs:

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown argument "gitRemote" on field "file" of type "Query".

File: node_modules/gatsby-theme-apollo-docs/gatsby-node.js:271:19


 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "fields" on type "File".

If you don't expect "fields" to exist on the type "File" it is most likely a typo.
However, if you expect "fields" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "fields" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "File":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: node_modules/gatsby-theme-apollo-docs/gatsby-node.js:271:19


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown argument "gitRemote" on field "file" of type "Query".

File: node_modules/gatsby-theme-apollo-docs/gatsby-node.js:271:19


 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "fields" on type "File".

If you don't expect "fields" to exist on the type "File" it is most likely a typo.
However, if you expect "fields" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "fields" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "File":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: node_modules/gatsby-theme-apollo-docs/gatsby-node.js:271:19


 ERROR #11321  PLUGIN

"gatsby-theme-apollo-docs" threw an error while running the createPages lifecycle:

Cannot destructure property `file` of 'undefined' or 'null'.

  283 |         `);
  284 | 
> 285 |         const {file} = response.data;
      |               ^
  286 |         return file && file.fields.raw;
  287 |       })
  288 |     );

File: node_modules/gatsby-theme-apollo-docs/gatsby-node.js:285:15



  TypeError: Cannot destructure property `file` of 'undefined' or 'null'.
  
  - gatsby-node.js:285 
    [docs]/[gatsby-theme-apollo-docs]/gatsby-node.js:285:15
  
  - task_queues.js:94 processTicksAndRejections
    internal/process/task_queues.js:94:5
  
  - async Promise.all
  
  - gatsby-node.js:270 async Object.exports.createPages
    [docs]/[gatsby-theme-apollo-docs]/gatsby-node.js:270:21
  
  - From previous event:
  
  - api-runner-node.js:258 runAPI
    [docs]/[gatsby]/dist/utils/api-runner-node.js:258:22
  
  - api-runner-node.js:375 Promise.catch.decorateEvent.pluginName
    [docs]/[gatsby]/dist/utils/api-runner-node.js:375:15
  
  - From previous event:
  
  - api-runner-node.js:374 
    [docs]/[gatsby]/dist/utils/api-runner-node.js:374:12
  
  - timers.js:439 processImmediate
    internal/timers.js:439:21
  
  - From previous event:
  
  - api-runner-node.js:368 
    [docs]/[gatsby]/dist/utils/api-runner-node.js:368:11
  
  - From previous event:
  
  - api-runner-node.js:275 module.exports
    [docs]/[gatsby]/dist/utils/api-runner-node.js:275:12
  
  - index.js:417 module.exports
    [docs]/[gatsby]/dist/bootstrap/index.js:417:9
  
  - develop-process.js:459 async module.exports
    [docs]/[gatsby]/dist/commands/develop-process.js:459:7
  

failed createPages - 0.084s
...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant