Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Started doc broken on create a document #2977

Closed
crystal-koii opened this issue Sep 4, 2024 · 1 comment · Fixed by #2989
Closed

Getting Started doc broken on create a document #2977

crystal-koii opened this issue Sep 4, 2024 · 1 comment · Fixed by #2989
Labels
bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@crystal-koii
Copy link

crystal-koii commented Sep 4, 2024

Describe the problem
_key doesn't exist on schema so it throws error:

defradb client query '
  mutation {
      create_User(input: {age: 31, verified: true, points: 90, name: "Bob"}) {
          _key             
      }
  }
> '
------ Request Results ------
{
  "data": null,
  "errors": [
    "Cannot query field \"_key\" on type \"User\"."
  ]
}

To Reproduce
Follow getting started https://docs.source.network/defradb

Expected behavior

{
  "data": [
    {
      "_key": "bae-91171025-ed21-50e3-b0dc-e31bccdfa1ab",
    }
  ]
}

Solution*
Update docs to return something that actually exists:

defradb client query '
mutation {
    create_User(input: {age: 31, verified: true, points: 90, name: "Bob"}) {
        _docID
    }
}
'
------ Request Results ------
{
  "data": {
    "create_User": [
      {
        "_docID": "bae-36fb9a9a-7af6-50cc-bc43-82e4c742a53e"
      }
    ]
  },
  "errors": null
}

NOTE: Also need to update everywhere else _key is used, it seems like _key has been replaced with _docID

@crystal-koii crystal-koii added the bug Something isn't working label Sep 4, 2024
@sourcenetwork sourcenetwork deleted a comment Sep 4, 2024
@fredcarle fredcarle added the documentation Improvements or additions to documentation label Sep 4, 2024
@fredcarle fredcarle added this to the DefraDB v0.14 milestone Sep 4, 2024
@fredcarle
Copy link
Collaborator

Thanks for opening the issue @crystal-koii. We do indeed need to update the docs to reflect the change from _key to _docID. The docs content is located within this repo. Was it your intention to make the changes yourself and open a PR for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants