Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import React from 'react'
  2. import { graphql } from "gatsby"
  3.  
  4. export default ({data}) => {
  5. return (
  6. <div>
  7. <h1>{data.swapi.posts_by_pk.title}</h1>
  8. <div>{data.swapi.posts_by_pk.description}</div>
  9. </div>
  10. )
  11. }
  12.  
  13. export const query = graphql`
  14. query postsByPk($slug: SWAPI_uuid!) {
  15. swapi {
  16. posts_by_pk(id: $slug) {
  17. id
  18. title
  19. created_at
  20. description
  21. }
  22. }
  23. }
  24.  
  25. `;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement