diff --git a/src/api/fetchCourse.js b/src/api/fetchCourse.js index 643ed52..50c1b22 100644 --- a/src/api/fetchCourse.js +++ b/src/api/fetchCourse.js @@ -13,7 +13,7 @@ export default function fetchCourse(courseInfo, udacityAuthToken) { const { key } = courseInfo; const queryGraphql = ` - {\"query\":\"\\n query CourseQuery {\\n course(key: \\\"${key}\\\" version: \\\"1.0.0\\\" locale: \\\"en-us\\\") {\\n id\\n key\\n version\\n locale\\n semantic_type\\n forum_path\\n title\\n is_public\\n is_default\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n instructors {\\n \\n image_url\\n first_name\\n\\n }\\n project_deadline {\\n \\n due_at\\n node_key\\n\\n }\\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n }\\n \\n aggregated_state {\\n node_key\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n lesson_aggregated_states {\\n node_key\\n completed_at\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n }\\n }\\n\\n lessons {\\n \\n id\\n key\\n version\\n locale\\n semantic_type\\n summary\\n title\\n duration\\n is_public\\n is_project_lesson\\n display_workspace_project_only\\n lesson_type\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n concepts {\\n id\\n key\\n is_public\\n semantic_type\\n title\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n }\\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n \\n project_state {\\n state\\n submissions {\\n created_at\\n url\\n result\\n is_legacy\\n id\\n status\\n }\\n }\\n\\n }\\n }\\n }\\n }\\n \",\"variables\":null,\"locale\":\"en-us\"} + {\"query\":\"\\n query CourseQuery {\\n course(key: \\\"${key}\\\" version: \\\"1.0.0\\\" locale: \\\"en-us\\\") {\\n id\\n key\\n version\\n locale\\n semantic_type\\n forum_path\\n title\\n is_public\\n is_default\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n instructors {\\n \\n image_url\\n first_name\\n\\n }\\n project_deadline {\\n \\n due_at\\n node_key\\n\\n }\\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n }\\n \\n aggregated_state {\\n node_key\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n lesson_aggregated_states {\\n node_key\\n completed_at\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n }\\n }\\n\\n lessons {\\n \\n id\\n key\\n version\\n locale\\n semantic_type\\n summary\\n title\\n duration\\n is_public\\n is_project_lesson\\n display_workspace_project_only\\n lesson_type\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n \\n concepts {\\n id\\n key\\n is_public\\n semantic_type\\n title\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n }\\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n \\n project_state {\\n state\\n submissions {\\n created_at\\n url\\n result\\n is_legacy\\n id\\n status\\n }\\n }\\n\\n }\\n }\\n }\\n }\\n \",\"variables\":null,\"locale\":\"en-us\"} `; return fetchApiUdacityGraphql(API_ENDPOINTS_UDACITY_GRAPHQL, queryGraphql, udacityAuthToken); diff --git a/src/api/fetchLesson.js b/src/api/fetchLesson.js index 0d3d031..3dab377 100644 --- a/src/api/fetchLesson.js +++ b/src/api/fetchLesson.js @@ -12,7 +12,7 @@ import { fetchApiUdacityGraphql } from '.'; export default function fetchCourse(lessonInfo, udacityAuthToken) { const { id, locale, rootKey } = lessonInfo; - const queryGraphql = `{\"query\":\"\\n query LessonQuery {\\n lesson(id: ${id}, root_key: \\\"${rootKey}\\\") {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n version\\n locale\\n summary\\n lesson_type\\n display_workspace_project_only\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n }\\n lab {\\n \\n id\\n key\\n version\\n locale\\n estimated_session_duration\\n duration\\n is_public\\n semantic_type\\n title\\n evaluation_objective\\n partners\\n overview {\\n title\\n summary\\n key_takeaways\\n video {\\n topher_id\\n youtube_id\\n }\\n }\\n details {\\n text\\n }\\n review_video {\\n topher_id\\n youtube_id\\n }\\n result {\\n state\\n skill_confidence_rating_after\\n skill_confidence_rating_before\\n }\\n workspace {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n workspace_id\\n pool_id\\n view_id\\n configuration\\n starter_files\\n }\\n\\n }\\n concepts {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n atoms {\\n ...on EmbeddedFrameAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n external_uri\\n instructor_notes\\n }\\n ...on TextAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n text\\n instructor_notes\\n }\\n ...on TaskListAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n tasks\\n positive_feedback\\n video_feedback {\\n youtube_id\\n china_cdn_id\\n }\\n description\\n }\\n ...on ImageAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n url\\n non_google_url\\n caption\\n alt\\n width\\n height\\n instructor_notes\\n }\\n ...on VideoAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n }\\n ...on ReflectAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n \\n ...on TextQuestion {\\n title\\n semantic_type\\n evaluation_id\\n text\\n }\\n\\n }\\n \\n answer {\\n text\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n }\\n\\n }\\n ...on RadioQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n prompt\\n answers {\\n id\\n text\\n is_correct\\n }\\n }\\n }\\n ...on CheckboxQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n prompt\\n answers {\\n id\\n text\\n is_correct\\n }\\n }\\n }\\n\\n ...on MatchingQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n complex_prompt {\\n text\\n }\\n concepts_label\\n answers_label\\n concepts {\\n text\\n correct_answer {\\n id\\n text\\n }\\n }\\n answers {\\n id\\n text\\n }\\n }\\n }\\n ...on ValidatedQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n prompt\\n matchers {\\n ...on RegexMatcher {\\n expression\\n }\\n }\\n }\\n }\\n ...on QuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n instruction {\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n text\\n }\\n question {\\n ...on ImageFormQuestion {\\n title\\n alt_text\\n background_image\\n non_google_background_image\\n semantic_type\\n evaluation_id\\n widgets {\\n group\\n initial_value\\n label\\n marker\\n model\\n is_text_area\\n tabindex\\n placement {\\n height\\n width\\n x\\n y\\n }\\n }\\n }\\n ...on ProgrammingQuestion {\\n title\\n semantic_type\\n evaluation_id\\n initial_code_files {\\n text\\n name\\n }\\n }\\n ...on CodeGradedQuestion {\\n title\\n prompt\\n semantic_type\\n evaluation_id\\n }\\n ...on IFrameQuestion {\\n title\\n semantic_type\\n evaluation_id\\n initial_code_files {\\n text\\n name\\n }\\n external_iframe_uri\\n }\\n \\n ...on TextQuestion {\\n title\\n semantic_type\\n evaluation_id\\n text\\n }\\n\\n }\\n \\n answer {\\n text\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n }\\n\\n }\\n ...on WorkspaceAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n workspace_id\\n pool_id\\n view_id\\n gpu_capable\\n configuration\\n starter_files\\n }\\n }\\n }\\n }\\n }\\n \",\"variables\":null,\"${locale}\":\"en-us\"}`; + const queryGraphql = `{\"query\":\"\\n query LessonQuery {\\n lesson(id: ${id}, root_key: \\\"${rootKey}\\\") {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n version\\n locale\\n summary\\n lesson_type\\n display_workspace_project_only\\n \\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n }\\n lab {\\n \\n id\\n key\\n version\\n locale\\n estimated_session_duration\\n duration\\n is_public\\n semantic_type\\n title\\n evaluation_objective\\n partners\\n overview {\\n title\\n summary\\n key_takeaways\\n video {\\n topher_id\\n youtube_id\\n }\\n }\\n details {\\n text\\n }\\n review_video {\\n topher_id\\n youtube_id\\n }\\n result {\\n state\\n skill_confidence_rating_after\\n skill_confidence_rating_before\\n }\\n workspace {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n workspace_id\\n pool_id\\n view_id\\n configuration\\n }\\n\\n }\\n concepts {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n atoms {\\n ...on EmbeddedFrameAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n external_uri\\n instructor_notes\\n }\\n ...on TextAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n text\\n instructor_notes\\n }\\n ...on TaskListAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n tasks\\n positive_feedback\\n video_feedback {\\n youtube_id\\n china_cdn_id\\n }\\n description\\n }\\n ...on ImageAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n url\\n caption\\n alt\\n width\\n height\\n instructor_notes\\n }\\n ...on VideoAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n }\\n ...on ReflectAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n \\n ...on TextQuestion {\\n title\\n semantic_type\\n evaluation_id\\n text\\n }\\n\\n }\\n \\n answer {\\n text\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n }\\n\\n }\\n ...on RadioQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n prompt\\n answers {\\n id\\n text\\n is_correct\\n }\\n }\\n }\\n ...on CheckboxQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n prompt\\n answers {\\n id\\n text\\n is_correct\\n }\\n }\\n }\\n\\n ...on MatchingQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n complex_prompt {\\n text\\n }\\n concepts_label\\n answers_label\\n concepts {\\n text\\n correct_answer {\\n id\\n text\\n }\\n }\\n answers {\\n id\\n text\\n }\\n }\\n }\\n ...on ValidatedQuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n question {\\n prompt\\n matchers {\\n ...on RegexMatcher {\\n expression\\n }\\n }\\n }\\n }\\n ...on QuizAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n instructor_notes\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n instruction {\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n text\\n }\\n question {\\n ...on ImageFormQuestion {\\n title\\n alt_text\\n background_image\\n semantic_type\\n evaluation_id\\n widgets {\\n group\\n initial_value\\n label\\n marker\\n model\\n is_text_area\\n tabindex\\n placement {\\n height\\n width\\n x\\n y\\n }\\n }\\n }\\n ...on ProgrammingQuestion {\\n title\\n semantic_type\\n evaluation_id\\n initial_code_files {\\n text\\n name\\n }\\n }\\n ...on CodeGradedQuestion {\\n title\\n prompt\\n semantic_type\\n evaluation_id\\n }\\n ...on IFrameQuestion {\\n title\\n semantic_type\\n evaluation_id\\n initial_code_files {\\n text\\n name\\n }\\n external_iframe_uri\\n }\\n \\n ...on TextQuestion {\\n title\\n semantic_type\\n evaluation_id\\n text\\n }\\n\\n }\\n \\n answer {\\n text\\n video {\\n youtube_id\\n china_cdn_id\\n }\\n }\\n\\n }\\n ...on WorkspaceAtom {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n workspace_id\\n pool_id\\n view_id\\n gpu_capable\\n configuration\\n }\\n }\\n }\\n }\\n }\\n \",\"variables\":null,\"${locale}\":\"en-us\"}`; return fetchApiUdacityGraphql(API_ENDPOINTS_UDACITY_GRAPHQL, queryGraphql, udacityAuthToken); } diff --git a/src/api/fetchNanodegree.js b/src/api/fetchNanodegree.js index 9fdbbc1..982f437 100644 --- a/src/api/fetchNanodegree.js +++ b/src/api/fetchNanodegree.js @@ -12,7 +12,6 @@ import { fetchApiUdacityGraphql } from '.'; export default function fetchNanodegree(ndInfo, udacityAuthToken) { const { key, locale, version } = ndInfo; - const queryGraphql = `{\"query\":\"\\n query NanodegreeQuery {\\n nanodegree(key: \\\"${key}\\\" version: \\\"${version}\\\" locale: \\\"${locale}\\\") {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n cohorts {\\n id\\n start_at\\n due_at\\n end_at\\n }\\n version\\n locale\\n title\\n color_scheme\\n enrollment {\\n product_variant\\n variant\\n static_access {\\n static_access\\n access_expiry_at\\n }\\n }\\n nd_units {\\n id\\n }\\n hero_image {\\n url\\n }\\n forum_path\\n summary\\n is_graduated\\n is_term_based\\n is_default\\n project_deadlines {\\n \\n due_at\\n node_key\\n\\n }\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n aggregated_state {\\n node_key\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n part_aggregated_states {\\n node_key\\n completed_at\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n module_aggregated_states {\\n node_key\\n completed_at\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n lesson_aggregated_states {\\n node_key\\n completed_at\\n completed_count\\n concept_count\\n completion_amount\\n last_viewed_child_key\\n }\\n }\\n }\\n }\\n\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n specializations {\\n key\\n title\\n required_count\\n }\\n parts {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n version\\n locale\\n summary\\n part_type\\n is_public\\n locked_reason\\n locked_until\\n content_ready_date_ms\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n specialization {\\n key\\n image {url width height}\\n video {youtube_id}\\n duration_in_weeks\\n overview\\n partners\\n resources\\n }\\n modules {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n version\\n locale\\n is_project_module\\n forum_path\\n lessons {\\n \\n id\\n key\\n version\\n locale\\n semantic_type\\n summary\\n title\\n duration\\n is_public\\n is_project_lesson\\n display_workspace_project_only\\n lesson_type\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n \\n video {\\n youtube_id\\n china_cdn_id\\n }\\n\\n lab {\\n \\n id\\n key\\n version\\n locale\\n estimated_session_duration\\n duration\\n is_public\\n semantic_type\\n title\\n evaluation_objective\\n partners\\n overview {\\n title\\n summary\\n key_takeaways\\n video {\\n topher_id\\n youtube_id\\n }\\n }\\n details {\\n text\\n }\\n review_video {\\n topher_id\\n youtube_id\\n }\\n result {\\n state\\n skill_confidence_rating_after\\n skill_confidence_rating_before\\n }\\n workspace {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n workspace_id\\n pool_id\\n view_id\\n configuration\\n starter_files\\n }\\n\\n }\\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n }\\n concepts {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n \\n resources {\\n files {\\n name\\n uri\\n }\\n google_plus_link\\n career_resource_center_link\\n coaching_appointments_link\\n office_hours_link\\n aws_provisioning_link\\n }\\n\\n }\\n }\\n }\\n }\\n }\\n }\\n \",\"variables\":null,\"locale\":\"en-us\"}`; - + const queryGraphql = `{\"query\":\"\\n query NanodegreeQuery {\\n nanodegree(key: \\\"${key}\\\" version: \\\"${version}\\\" locale: \\\"${locale}\\\") {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n cohorts {\\n id\\n start_at\\n due_at\\n end_at\\n }\\n version\\n locale\\n title\\n color_scheme\\n enrollment {\\n product_variant\\n variant\\n static_access {\\n static_access\\n access_expiry_at\\n }\\n }\\n nd_units {\\n id\\n }\\n hero_image {\\n url\\n }\\n forum_path\\n summary\\n is_graduated\\n is_default\\n project_deadlines {\\n \\n due_at\\n }\\n \\n user_state {\\n node_key\\n completed_at\\n last_viewed_at\\n unstructured\\n }\\n\\n \\n aggregated_state {\\n node_key\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n part_aggregated_states {\\n node_key\\n completed_at\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n module_aggregated_states {\\n node_key\\n completed_at\\n completion_amount\\n completed_count\\n concept_count\\n last_viewed_child_key\\n lesson_aggregated_states {\\n node_key\\n completed_at\\n completed_count\\n concept_count\\n completion_amount\\n last_viewed_child_key\\n }\\n }\\n }\\n }\\n\\n \\n \\n\\n parts {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n version\\n locale\\n summary\\n part_type\\n is_public\\n \\n \\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n modules {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n version\\n locale\\n is_project_module\\n forum_path\\n lessons {\\n \\n id\\n key\\n version\\n locale\\n semantic_type\\n summary\\n title\\n duration\\n is_public\\n is_project_lesson\\n display_workspace_project_only\\n lesson_type\\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n \\n video {\\n youtube_id\\n china_cdn_id\\n }\\n\\n lab {\\n \\n id\\n key\\n version\\n locale\\n estimated_session_duration\\n duration\\n is_public\\n semantic_type\\n title\\n evaluation_objective\\n partners\\n overview {\\n title\\n summary\\n key_takeaways\\n video {\\n topher_id\\n youtube_id\\n }\\n }\\n details {\\n text\\n }\\n review_video {\\n topher_id\\n youtube_id\\n }\\n result {\\n state\\n skill_confidence_rating_after\\n skill_confidence_rating_before\\n }\\n workspace {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n workspace_id\\n pool_id\\n view_id\\n configuration\\n }\\n\\n }\\n project {\\n \\n key\\n version\\n locale\\n duration\\n semantic_type\\n title\\n description\\n is_public\\n summary\\n forum_path\\n rubric_id\\n terminal_project_id\\n \\n \\n\\n \\n image {\\n url\\n width\\n height\\n }\\n\\n\\n }\\n concepts {\\n \\n id\\n key\\n title\\n semantic_type\\n is_public\\n\\n \\n \\n\\n }\\n }\\n }\\n }\\n }\\n }\\n \",\"variables\":null,\"locale\":\"en-us\"}`; return fetchApiUdacityGraphql(API_ENDPOINTS_UDACITY_GRAPHQL, queryGraphql, udacityAuthToken); } diff --git a/src/api/fetchUdacityUserInfo.js b/src/api/fetchUdacityUserInfo.js index eabfd22..3d560b6 100644 --- a/src/api/fetchUdacityUserInfo.js +++ b/src/api/fetchUdacityUserInfo.js @@ -9,7 +9,6 @@ import { fetchApiUdacityGraphql } from '.'; * @param {string} udacityAuthToken Udacity authentication token */ export default function fetchUdacityUserInfo(udacityAuthToken) { - const queryGraphql = '{"query":"\\n query UserBaseQuery {\\n user {\\n id\\n first_name\\n last_name\\n email\\n nickname\\n preferred_language\\n affiliate_program_key\\n can_see_professional_profile\\n can_edit_content\\n \\n email_preferences {\\n receive_marketing\\n }\\n\\n \\n settings {\\n skip_classroom_welcome\\n dismissed_upgrade_ids\\n onboarding_completed_keys\\n }\\n\\n social_logins {\\n provider\\n id\\n }\\n user_tags {\\n namespace\\n tag\\n }\\n nanodegrees(start_index: 0, is_graduated: false) {\\n id\\n key\\n title\\n locale\\n version\\n semantic_type\\n user_state {\\n last_viewed_at\\n }\\n }\\n graduated_nanodegrees: nanodegrees(is_graduated: true) {\\n id\\n key\\n locale\\n version\\n }\\n courses(start_index: 0, is_graduated: false) {\\n id\\n key\\n title\\n locale\\n version\\n semantic_type\\n user_state {\\n last_viewed_at\\n }\\n }\\n graduated_courses: courses(is_graduated: true) {\\n id\\n key\\n locale\\n version\\n }\\n }\\n }\\n ","variables":null,"locale":"en-us"}'; - + const queryGraphql = '{"query":"\\n query UserBaseQuery {\\n user {\\n id\\n first_name\\n last_name\\n email\\n nickname\\n preferred_language\\n affiliate_program_key\\n can_edit_content\\n \\n \\n settings {\\n skip_classroom_welcome\\n dismissed_upgrade_ids\\n onboarding_completed_keys\\n }\\n\\n social_logins {\\n provider\\n id\\n }\\n user_tags {\\n namespace\\n tag\\n }\\n nanodegrees(start_index: 0, is_graduated: false) {\\n id\\n key\\n title\\n locale\\n version\\n semantic_type\\n user_state {\\n last_viewed_at\\n }\\n }\\n graduated_nanodegrees: nanodegrees(is_graduated: true) {\\n id\\n key\\n locale\\n version\\n }\\n courses(start_index: 0, is_graduated: false) {\\n id\\n key\\n title\\n locale\\n version\\n semantic_type\\n user_state {\\n last_viewed_at\\n }\\n }\\n graduated_courses: courses(is_graduated: true) {\\n id\\n key\\n locale\\n version\\n }\\n }\\n }\\n ","variables":null,"locale":"en-us"}'; return fetchApiUdacityGraphql(API_ENDPOINTS_UDACITY_GRAPHQL, queryGraphql, udacityAuthToken); }